提交 be4379c1 authored 作者: Iban Harlouchet's avatar Iban Harlouchet

__props__ for theano/gof/tests/test_op.py

上级 de0cd14e
...@@ -56,6 +56,8 @@ class MyType(Type): ...@@ -56,6 +56,8 @@ class MyType(Type):
class MyOp(Op): class MyOp(Op):
__props__ = ()
def make_node(self, *inputs): def make_node(self, *inputs):
inputs = list(map(as_variable, inputs)) inputs = list(map(as_variable, inputs))
for input in inputs: for input in inputs:
...@@ -70,12 +72,7 @@ MyOp = MyOp() ...@@ -70,12 +72,7 @@ MyOp = MyOp()
class NoInputOp(Op): class NoInputOp(Op):
"""An Op to test the corner-case of an Op with no input.""" """An Op to test the corner-case of an Op with no input."""
__props__ = ()
def __eq__(self, other):
return type(self) == type(other)
def __hash__(self):
return hash(type(self))
def make_node(self): def make_node(self):
return Apply(self, [], [MyType('test')()]) return Apply(self, [], [MyType('test')()])
...@@ -162,12 +159,7 @@ class TestMakeThunk(unittest.TestCase): ...@@ -162,12 +159,7 @@ class TestMakeThunk(unittest.TestCase):
def test_no_c_code(self): def test_no_c_code(self):
class IncOnePython(Op): class IncOnePython(Op):
"""An Op with only a Python (perform) implementation""" """An Op with only a Python (perform) implementation"""
__props__ = ()
def __eq__(self, other):
return type(self) == type(other)
def __hash__(self):
return hash(type(self))
def make_node(self, input): def make_node(self, input):
input = scalar.as_scalar(input) input = scalar.as_scalar(input)
...@@ -204,12 +196,7 @@ class TestMakeThunk(unittest.TestCase): ...@@ -204,12 +196,7 @@ class TestMakeThunk(unittest.TestCase):
def test_no_perform(self): def test_no_perform(self):
class IncOneC(Op): class IncOneC(Op):
"""An Op with only a C (c_code) implementation""" """An Op with only a C (c_code) implementation"""
__props__ = ()
def __eq__(self, other):
return type(self) == type(other)
def __hash__(self):
return hash(type(self))
def make_node(self, input): def make_node(self, input):
input = scalar.as_scalar(input) input = scalar.as_scalar(input)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论