提交 cdae9037 authored 作者: ricardoV94's avatar ricardoV94 提交者: Ricardo Vieira

Fix TrueDiv gradient for integer inputs

上级 aa616e6f
...@@ -2036,7 +2036,10 @@ class TrueDiv(BinaryScalarOp): ...@@ -2036,7 +2036,10 @@ class TrueDiv(BinaryScalarOp):
# to the output; x/y is still a function of x # to the output; x/y is still a function of x
# and y; it's just a step function. # and y; it's just a step function.
if all(a.dtype in discrete_dtypes for a in (x, y)): if all(a.dtype in discrete_dtypes for a in (x, y)):
return [x.zeros_like(), y.zeros_like()] return [
x.zeros_like(dtype=config.floatX),
y.zeros_like(dtype=config.floatX),
]
first_part = gz / y first_part = gz / y
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论