Reshape   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A compute_tensor() 0 2 1
A __init__() 0 3 1
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)