From 7fab79232f638900c71672fde8b8b35e6e683b7a Mon Sep 17 00:00:00 2001 From: Weilong Wu Date: Thu, 1 Sep 2022 20:07:10 +0800 Subject: [PATCH] [Eager] fix abs interface under different mode (#45640) --- python/paddle/tensor/linalg.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/paddle/tensor/linalg.py b/python/paddle/tensor/linalg.py index 652cfb37289..4ac0082f115 100644 --- a/python/paddle/tensor/linalg.py +++ b/python/paddle/tensor/linalg.py @@ -767,10 +767,11 @@ def cond(x, p=None, name=None): keepdim = False if _non_static_mode(): - abs_out = _legacy_C_ops.abs(input) if in_dygraph_mode(): + abs_out = _C_ops.abs(input) sum_out = _C_ops.sum(abs_out, axis, None, keepdim) else: + abs_out = _legacy_C_ops.abs(input) sum_out = _legacy_C_ops.reduce_sum(abs_out, 'dim', axis, 'keepdim', keepdim, 'reduce_all', reduce_all) -- GitLab