提交 c9a2c0dd authored 作者: Razvan Pascanu's avatar Razvan Pascanu

Implementation of the hash method

The previous code was copy paste from the old scan and it did not respect the new scan internals.
上级 2bb742eb
......@@ -140,11 +140,14 @@ class ScanOp(PureOp):
return aux_txt
def __hash__(self):
return (hash(type(self)) ^
# and a hash representing the inner graph using the
# CLinker.cmodule_key_
self._hash_inner_graph ^
scan_utils.hash_listsDictsTuples(self.info))
rval = hash(type(self)) ^ self.hash_inner_graph
for val in self.options.values():
if isinstance(val, (list, tuple)):
for el in val:
rval = rval ^ el
else:
rval = rval ^ val
return rval
def make_thunk(self, node, storage_map, compute_map, no_recycling):
pass
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论