提交 849c8346 authored 作者: Frederic Bastien's avatar Frederic Bastien

more strict before doing an optimization.

上级 53abe8ea
......@@ -505,11 +505,11 @@ def local_gpu_subtensor(node):
def local_gpu_advanced_subtensor1(node):
if node.op == gpu_from_host:
host_input = node.inputs[0]
if host_input.owner and isinstance(host_input.owner.op, tensor.AdvancedSubtensor1):
if host_input.owner and host_input.owner.op.__class__ is tensor.AdvancedSubtensor1:
x = host_input.owner.inputs[0]
coords = host_input.owner.inputs[1:]
return [GpuAdvancedSubtensor1()(gpu_from_host(x), *coords)]
if isinstance(node.op, tensor.AdvancedSubtensor1):
if node.op.__class__ is tensor.AdvancedSubtensor1:
x = node.inputs[0]
coords = node.inputs[1:]
if x.owner and x.owner.op == host_from_gpu:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论