未验证 提交 1523ddc8 编写于 作者: W Weilong Wu 提交者: GitHub

[Eager, Performance optimization] use _C_ops.divide under eager mode (#45731)

上级 095e8b49
...@@ -906,9 +906,13 @@ def cond(x, p=None, name=None): ...@@ -906,9 +906,13 @@ def cond(x, p=None, name=None):
keepdim, 'reduce_all', keepdim, 'reduce_all',
reduce_all) reduce_all)
if porder == 2: if porder == 2:
if in_dygraph_mode():
return _C_ops.divide(max_out, min_out)
return _legacy_C_ops.elementwise_div(max_out, min_out, 'aixs', return _legacy_C_ops.elementwise_div(max_out, min_out, 'aixs',
axis, 'use_mkldnn', False) axis, 'use_mkldnn', False)
if porder == -2: if porder == -2:
if in_dygraph_mode():
return _C_ops.divide(min_out, max_out)
return _legacy_C_ops.elementwise_div(min_out, max_out, 'aixs', return _legacy_C_ops.elementwise_div(min_out, max_out, 'aixs',
axis, 'use_mkldnn', False) axis, 'use_mkldnn', False)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册