提交 db74811a authored 作者: f0k's avatar f0k

Fix values_eq_approx() for GpuAllocEmpty

上级 bd4c6b19
......@@ -3275,7 +3275,9 @@ class GpuAllocEmpty(GpuOp):
const_shp = None
bcast.append(numpy.all(1 == const_shp))
otype = CudaNdarrayType(dtype='float32', broadcastable=bcast)
return Apply(self, sh, [otype()])
output = otype()
output.values_eq_approx = tensor.type.values_eq_approx_always_true
return Apply(self, sh, [output])
def perform(self, node, inputs, out_):
out, = out_
......
......@@ -630,6 +630,10 @@ def values_eq_approx_remove_inf_nan(a, b):
return TensorType.values_eq_approx(a, b, True, True)
def values_eq_approx_always_true(a, b):
return True
# Register TensorType C code for ViewOp.
theano.compile.register_view_op_c_code(
TensorType,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论