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

Fix bug in computing hash

reconstruct_graph always replaces CudaNdarrays with TensorTypes, so in case of a gpu scan op, we can not use that logic to generate a hash ( I compute it locally when I am generating the gpu scan op).
上级 c28d13a0
...@@ -141,11 +141,14 @@ class Scan(Op): ...@@ -141,11 +141,14 @@ class Scan(Op):
self.n_shared_outs ) self.n_shared_outs )
self.n_outs = self.n_mit_mot + self.n_mit_sot + self.n_sit_sot self.n_outs = self.n_mit_mot + self.n_mit_sot + self.n_sit_sot
self.n_tap_outs = self.n_mit_mot + self.n_mit_sot self.n_tap_outs = self.n_mit_mot + self.n_mit_sot
if not self.info['gpu']:
tmp_in, tmp_out = scan_utils.reconstruct_graph(self.inputs, tmp_in, tmp_out = scan_utils.reconstruct_graph(self.inputs,
self.outputs) self.outputs)
local_env = gof.Env(tmp_in, tmp_out) local_env = gof.Env(tmp_in, tmp_out)
self._cmodule_key = gof.CLinker.cmodule_key_(local_env,[]) self._cmodule_key = gof.CLinker.cmodule_key_(local_env,[])
self._hash_inner_graph = hash(self._cmodule_key) self._hash_inner_graph = hash(self._cmodule_key)
else:
self._hash_inner_graph = self.info['gpu_hash']
def make_node(self, *inputs): def make_node(self, *inputs):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论