提交 cd442e56 authored 作者: Frederic's avatar Frederic

Remove useless opt error to the user (and maybe move more stuff to the GPU)

上级 367aedf8
...@@ -795,6 +795,11 @@ def local_gpu_careduce(node): ...@@ -795,6 +795,11 @@ def local_gpu_careduce(node):
replace = False replace = False
if x.owner and isinstance(x.owner.op, HostFromGpu): if x.owner and isinstance(x.owner.op, HostFromGpu):
replace = True replace = True
# If this is a useless reduce, remove it as
# local_cut_useless_reduce. This is needed as the code
# bellow do not support when x.ndim == 0.
if x.type == node.outputs[0].type:
return [x]
elif (all([c != "output" and isinstance(c.op, GpuFromHost) elif (all([c != "output" and isinstance(c.op, GpuFromHost)
for c, i in node.outputs[0].clients]) for c, i in node.outputs[0].clients])
and x.owner and x.owner.op.__class__ in and x.owner and x.owner.op.__class__ in
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论