Completed
Push — master ( 5937d6...900a69 )
by Raphael
01:44
created

ifelse()   A

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
#!/usr/bin/env python
2
# -*- coding: utf-8 -*-
3
4
from concat import Concatenate
5
from theano.ifelse import ifelse as theano_ifelse
6
from deepy.utils.decorations import neural_computation
7
8
def concatenate(vars, axis=-1):
9
    """
10
    A utility function of concatenate.
11
    """
12
    return Concatenate(axis=axis).compute(*vars)
13
14
@neural_computation
15
def ifelse(condition, then_branch, else_branch):
16
    return theano_ifelse(condition, then_branch, else_branch)
17
18