From b68f1120fcbdf89a3fe90883138405f2957470a1 Mon Sep 17 00:00:00 2001 From: Weilong Wu Date: Fri, 19 Aug 2022 14:21:45 +0800 Subject: [PATCH] [Eager] polish scale and pow python interface logic (#45259) --- python/paddle/tensor/math.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/python/paddle/tensor/math.py b/python/paddle/tensor/math.py index 4d9f170d39..b161eeedc9 100644 --- a/python/paddle/tensor/math.py +++ b/python/paddle/tensor/math.py @@ -176,8 +176,7 @@ def scale(x, scale=1.0, bias=0.0, bias_after_scale=True, act=None, name=None): """ if in_dygraph_mode(): - out = _C_ops.final_state_scale(x, scale, float(bias), bias_after_scale) - return dygraph_utils._append_activation_in_dygraph(out) + return _C_ops.final_state_scale(x, scale, float(bias), bias_after_scale) if _non_static_mode(): _scale = scale.numpy().item(0) if isinstance(scale, Variable) else scale out = _C_ops.scale(x, 'scale', @@ -386,8 +385,7 @@ def pow(x, y, name=None): if isinstance(y, (int, float)): return _C_ops.final_state_pow(x, y) elif isinstance(y, (paddle.Tensor, Variable)): - return _elementwise_op_in_dygraph( - x, y, axis=-1, act=None, op_name='elementwise_pow') + return _C_ops.final_state_elementwise_pow(x, y) else: raise TypeError('y must be scalar or tensor type, but received: %s '% (y.dtype)) if _in_legacy_dygraph(): -- GitLab