Completed
Push — master ( 0a4690...96c2cd )
by Raphael
01:14
created

deepy.utils.NeuralTensor.__getattr__()   A

Complexity

Conditions 2

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 2
dl 0
loc 5
rs 9.4285

1 Method

Rating   Name   Duplication   Size   Complexity  
A deepy.utils.NeuralTensor.wrapper() 0 3 1
1
#!/usr/bin/env python
2
# -*- coding: utf-8 -*-
3
4
from theano import tensor
5
from decorations import neural_computation
6
7
class NeuralTensor():
8
    """
9
    A class for exporting Theano tensor operations to neural variables.
10
    """
11
12
    def __getattr__(self, func_name):
13
        @neural_computation
14
        def wrapper(*args, **kwargs):
15
            return getattr(tensor, func_name)(*args, **kwargs)
16
        return wrapper
17
18
19
neural_tensor = NeuralTensor()
20
NT = neural_tensor