提交 43f99162 authored 作者: Melanie Ducoffe's avatar Melanie Ducoffe

bla bla

上级 ac8cb3fe
...@@ -2280,9 +2280,24 @@ def gpuScanOptimization(node): ...@@ -2280,9 +2280,24 @@ def gpuScanOptimization(node):
@local_optimizer([tensor.AllocEmpty, gpu_from_host]) @local_optimizer([tensor.AllocEmpty, gpu_from_host])
def local_gpu_allocempty(node): def local_gpu_allocempty(node):
if (isinstance(node.op, tensor.AllocEmpty) and if (isinstance(node.op, tensor.AllocEmpty) and
<<<<<<< HEAD
node.op.dtype=="float32"): node.op.dtype=="float32"):
return [host_from_gpu(GpuAllocEmpty()(*node.inputs))] return [host_from_gpu(GpuAllocEmpty()(*node.inputs))]
return False return False
=======
node.op.dtype=="NPY_FLOAT_32"):
if any([(i.owner and isinstance(i.owner.op, HostFromGpu))
for i in node.inputs]):
return [host_from_gpu(GpuAllocEmpty("float32")(gpu_from_host(*node.inputs)))]
if isinstance(node.op, GpuFromHost):
host_input = node.inputs[0]
if (host_input.owner and
isinstance(host_input.owner.op, tensor.AllocEmpty) and
host_input.owner.op.dtype=="NPY_FLOAT_32"):
owner = host_input.owner
return [GpuAllocEmpty()(
gpu_from_host(*owner.inputs))]
>>>>>>> bla bla
optdb.register('gpu_scanOp_make_inplace', optdb.register('gpu_scanOp_make_inplace',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论