Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
class retNone(gof.op.Op):
def make_node(self, *inputs):
outputs = [gof.generic()]
return gof.Apply(self, inputs, outputs)
def grad(self, inputs, (gz, )):
return [None]
i = gof.generic()
j = gof.generic()
a1 = retNone().make_node(i)
g = grad_sources_inputs([(a1.out, 1)], None)
a2 = retNone().make_node(i,j)
try:
g = grad_sources_inputs([(a2.out, 1)], None)
except ValueError, e:
self.failUnless(e[0] is gradient._msg_badlen)
return
self.fail()