Reshape.compute_tensor()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
#!/usr/bin/env python
2
# -*- coding: utf-8 -*-
3
4
from . import NeuralLayer
5
6
class Reshape(NeuralLayer):
7
    """
8
    Reshape layer.
9
    """
10
11
    def __init__(self, pattern):
12
        super(Reshape, self).__init__("dimshuffle")
13
        self.pattern = pattern
14
15
    def compute_tensor(self, x):
16
        return x.reshape(self.pattern)