未验证 提交 7fab7923 编写于 作者: W Weilong Wu 提交者: GitHub

[Eager] fix abs interface under different mode (#45640)

上级 76023c34
...@@ -767,10 +767,11 @@ def cond(x, p=None, name=None): ...@@ -767,10 +767,11 @@ def cond(x, p=None, name=None):
keepdim = False keepdim = False
if _non_static_mode(): if _non_static_mode():
abs_out = _legacy_C_ops.abs(input)
if in_dygraph_mode(): if in_dygraph_mode():
abs_out = _C_ops.abs(input)
sum_out = _C_ops.sum(abs_out, axis, None, keepdim) sum_out = _C_ops.sum(abs_out, axis, None, keepdim)
else: else:
abs_out = _legacy_C_ops.abs(input)
sum_out = _legacy_C_ops.reduce_sum(abs_out, 'dim', axis, sum_out = _legacy_C_ops.reduce_sum(abs_out, 'dim', axis,
'keepdim', keepdim, 'keepdim', keepdim,
'reduce_all', reduce_all) 'reduce_all', reduce_all)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册