提交 704c0bde authored 作者: Frederic's avatar Frederic

Partially make more test op c code versinable.

上级 bb00e661
......@@ -60,7 +60,13 @@ class TDouble(Type):
""" % locals()
def c_code_cache_version(self):
return ()
return (1,)
def __eq__(self, other):
return type(self) == type(other)
def __hash__(self):
return hash(type(self))
tdouble = TDouble()
......@@ -87,6 +93,14 @@ class MyOp(Op):
def __str__(self):
return self.name
def __eq__(self, other):
return (type(self) == type(other) and
self.name == other.name and
self.nin == other.nin)
def __hash__(self):
return hash(type(self)) ^ hash(self.name) ^ hash(self.nin)
def perform(self, node, inputs, out_):
out, = out_
out[0] = self.impl(*inputs)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论