提交 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): ...@@ -140,11 +140,14 @@ class ScanOp(PureOp):
return aux_txt return aux_txt
def __hash__(self): def __hash__(self):
return (hash(type(self)) ^ rval = hash(type(self)) ^ self.hash_inner_graph
# and a hash representing the inner graph using the for val in self.options.values():
# CLinker.cmodule_key_ if isinstance(val, (list, tuple)):
self._hash_inner_graph ^ for el in val:
scan_utils.hash_listsDictsTuples(self.info)) rval = rval ^ el
else:
rval = rval ^ val
return rval
def make_thunk(self, node, storage_map, compute_map, no_recycling): def make_thunk(self, node, storage_map, compute_map, no_recycling):
pass pass
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论