提交 ba4aefff authored 作者: Frédéric Bastien's avatar Frédéric Bastien

Merge pull request #4593 from nouiz/gh_4585

Fix gh-4585. Cast the constant to the right dtype.
...@@ -2543,7 +2543,7 @@ class Log2(UnaryScalarOp): ...@@ -2543,7 +2543,7 @@ class Log2(UnaryScalarOp):
else: else:
return [x.zeros_like()] 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): def c_code(self, node, name, inputs, outputs, sub):
(x,) = inputs (x,) = inputs
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论