Completed
Push — master ( 394368...090fba )
by Raphael
01:33
created

DisconnectedGrad   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A grad() 0 2 2
A connection_pattern() 0 2 1
1
#!/usr/bin/env python
2
# -*- coding: utf-8 -*-
3
from theano.compile import ViewOp
4
from theano.gradient import DisconnectedType
5
6
7
class DisconnectedGrad(ViewOp):
8
    def grad(self, args, g_outs):
9
        return [ DisconnectedType()() for g_out in g_outs]
10
11
    def connection_pattern(self, node):
12
        return [[False]]
13
14
15
disconnected_grad = DisconnectedGrad()