提交 9ba08fd0 authored 作者: Frederic Bastien's avatar Frederic Bastien

small modif

上级 efe85d2a
...@@ -2150,7 +2150,7 @@ class Abs(UnaryScalarOp): ...@@ -2150,7 +2150,7 @@ class Abs(UnaryScalarOp):
else: else:
return [x.zeros_like()] return [x.zeros_like()]
if x.dtype.startswith('float'): if x.type in float_types:
return gz * sgn(x), return gz * sgn(x),
return gz * x / abs(x), # formula works for complex and real return gz * x / abs(x), # formula works for complex and real
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论