Completed
Push — master ( c8682f...5bbe2a )
by Raphael
01:33
created

deepy.layers.Combine.test_output()   A

Complexity

Conditions 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
dl 0
loc 2
rs 10
1
from . import NeuralLayer
2
3
4
class Combine(NeuralLayer):
5
    """
6
    Combine two variables.
7
    """
8
9
    def __init__(self, func, dim=0):
10
        """
11
        :type layer1: NeuralLayer
12
        :type layer2: NeuralLayer
13
        """
14
        super(Combine, self).__init__("combine")
15
        self.func = func
16
        if dim > 0:
17
            self.output_dim = dim
18
19
    def prepare(self):
20
        if self.output_dim == 0:
21
            self.output_dim = self.input_dim
22
23
    def output(self, *tensors):
24
        return self.func(*tensors)
25
26
    def test_output(self, *tensors):
27
        return self.func(*tensors)
28