提交 26a57815 authored 作者: Frederic Bastien's avatar Frederic Bastien

don't make a copy during optimization phase before inplace operation.

上级 02172757
...@@ -137,10 +137,7 @@ def local_gpu_dimshuffle_0(node): ...@@ -137,10 +137,7 @@ def local_gpu_dimshuffle_0(node):
# move the add to a GpuAdd # move the add to a GpuAdd
new_op = GpuDimShuffle(node.op.input_broadcastable, new_op = GpuDimShuffle(node.op.input_broadcastable,
node.op.new_order) node.op.new_order)
if node.op.inplace: return [host_from_gpu(new_op(gpu_from_host(input)))]
return [host_from_gpu(new_op(gpu_from_host(input)))]
else:
return [host_from_gpu(new_op(gpu_from_host(tensor.tensor_copy(input))))]
if node.op == gpu_from_host: if node.op == gpu_from_host:
host_input = node.inputs[0] host_input = node.inputs[0]
if host_input.owner and isinstance(host_input.owner.op, tensor.DimShuffle): if host_input.owner and isinstance(host_input.owner.op, tensor.DimShuffle):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论