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

Added corrections to builders.py

上级 4670fdb0
...@@ -65,7 +65,6 @@ class OpFromGraph(gof.Op): ...@@ -65,7 +65,6 @@ class OpFromGraph(gof.Op):
fn = function([x, y, z], [e2]) fn = function([x, y, z], [e2])
""" """
__props__ = ()
def __init__(self, inputs, outputs, **kwargs): def __init__(self, inputs, outputs, **kwargs):
if not isinstance(outputs, list): if not isinstance(outputs, list):
...@@ -102,6 +101,14 @@ class OpFromGraph(gof.Op): ...@@ -102,6 +101,14 @@ class OpFromGraph(gof.Op):
self.input_types = [input.type for input in inputs] self.input_types = [input.type for input in inputs]
self.output_types = [output.type for output in outputs] self.output_types = [output.type for output in outputs]
def __eq__(self, other):
# TODO: recognize a copy
return self is other
def __hash__(self):
# TODO: use internal variables in hash
return hash(type(self))
def make_node(self, *inputs): def make_node(self, *inputs):
for input, type in zip(inputs, self.input_types): for input, type in zip(inputs, self.input_types):
if not type == input.type: if not type == input.type:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论