提交 788198b4 authored 作者: Frederic Bastien's avatar Frederic Bastien

Fix gh-4585. Cast the constant to the right dtype.

上级 2a9da88c
......@@ -2543,7 +2543,7 @@ class Log2(UnaryScalarOp):
else:
return [x.zeros_like()]
return gz / (x * math.log(2.0)),
return gz / (x * numpy.asarray(math.log(2.0)).astype(x.dtype)),
def c_code(self, node, name, inputs, outputs, sub):
(x,) = inputs
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论