提交 00b3d02e authored 作者: Frederic's avatar Frederic

Fix bug introduced by gh-1794 merged 7 days ago.

This make the perform method of Elemwise return the wrong dtype in some cases.
上级 b1402c8b
...@@ -874,7 +874,10 @@ class Elemwise(OpenMPOp): ...@@ -874,7 +874,10 @@ class Elemwise(OpenMPOp):
odat[...] = variable odat[...] = variable
storage[0] = odat storage[0] = odat
# Sometimes NumPy return a Python type. # Sometimes NumPy return a Python type.
elif not isinstance(variable, numpy.ndarray): # Some Theano op return a different dtype like floor, ceil,
# trunc, eq, ...
elif (not isinstance(variable, numpy.ndarray) or
variable.dtype != nout.dtype):
variable = numpy.asarray(variable, nout.dtype) variable = numpy.asarray(variable, nout.dtype)
storage[0] = variable storage[0] = variable
else: else:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论