提交 db6fc48d authored 作者: Ramana.S's avatar Ramana.S

mend

上级 e3430b61
......@@ -765,10 +765,6 @@ class Op(utils.object2, PureOp, CLinkerOp):
Convenience class to bundle `PureOp` and `CLinkerOp`.
"""
def __new__(cls, *args, **kwargs):
# this function exists to silently and transparently ensure that all
# existing Ops get a _op_use_c_code attribute
......@@ -936,7 +932,7 @@ class Op(utils.object2, PureOp, CLinkerOp):
# condition: either there was no c_code, or it failed
return self.make_py_thunk(node, storage_map, compute_map, no_recycling)
def make_node(self, *inputs):
if not hasattr(self, 'itypes'):
......
......@@ -59,7 +59,6 @@ class MyOp(Op):
__props__ = ()
'''
def make_node(self, *inputs):
inputs = list(map(as_variable, inputs))
for input in inputs:
......@@ -67,7 +66,6 @@ class MyOp(Op):
raise Exception("Error 1")
outputs = [MyType(sum([input.type.thingy for input in inputs]))()]
return Apply(self, inputs, outputs)
'''
MyOp = MyOp()
......@@ -384,28 +382,5 @@ def test_debug_error_message():
finally:
config.compute_test_value = prev_value
'''
def test_make_node():
x = T.dmatrix('x')
x.tag.test_value = numpy.zeros((2, 2))
y = T.dvector('y')
y.tag.test_value = [0, 0]
with unittest.assertRaisesRegexp(NotImplementedError, "itypes not defined") :
@as_op(itypes=[], otypes=T.dvector)
def none_itypes(x,y):
return numpy.dot(x,y)
none_itypes(x,y)
with assertRaisesRegexp(NotImplementedError, "otypes not defined") :
@as_op(itypes=[T.dmatrix, T.dvector], otypes=[])
def none_otypes(x,y):
return numpy.dot(x,y)
none_otypes(x, y)
'''
if __name__ == '__main__':
unittest.main()
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论