Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_retNone1(self):
"""Test that it is not ok to return None from op.grad()"""
class retNone(gof.op.Op):
def make_node(self):
inputs = [gof.generic()]
outputs = [gof.generic()]
return gof.Apply(self, inputs, outputs)
def grad(self, (x, ), (gz, )):
pass
a = retNone().make_node()
try:
grad_sources_inputs([(a.out, 1)], None)
except ValueError, e:
self.failUnless(e[0] is gradient._msg_retType)
return
self.fail()
def test_retNone1_b(self):