提交 b24d1a8d authored 作者: abergeron's avatar abergeron

Merge pull request #2806 from carriepl/scan_new_backend

[CRASH with Scan in new backend]
...@@ -608,7 +608,7 @@ class GpuAlloc(HideC, Alloc): ...@@ -608,7 +608,7 @@ class GpuAlloc(HideC, Alloc):
v = inputs[0] v = inputs[0]
sh = tuple(map(int, inputs[1:])) sh = tuple(map(int, inputs[1:]))
if out[0] is None or out[0].shape != sh: if out[0] is None or out[0].shape != sh:
if v.size == 1 and numpy.asarray(v)[0].item() == 0: if v.size == 1 and numpy.asarray(v).flatten().item() == 0:
out[0] = gpuarray.zeros(sh, dtype=v.dtype) out[0] = gpuarray.zeros(sh, dtype=v.dtype)
else: else:
out[0] = gpuarray.empty(sh, dtype=v.dtype) out[0] = gpuarray.empty(sh, dtype=v.dtype)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论