提交 ef01a4e1 authored 作者: Frederic Bastien's avatar Frederic Bastien

Fix new opt

上级 8b0ed6f0
......@@ -2543,7 +2543,8 @@ def local_gpu_allocempty(node):
# Don't register by default.
@gof.local_optimizer([GpuAllocEmpty])
def local_gpu_alloc_empty_to_zeros(node):
if isinstance(node.op, GpuAllocEmpty):
# We need the exact match as GpuAlloc inherit from GpuAllocEmpty.
if type(node.op) is GpuAllocEmpty:
return [gpu_alloc(theano.tensor.constant(0, dtype='float32'),
*node.inputs)]
optdb.register('local_gpu_alloc_empty_to_zeros',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论