Skip to content

Commit 38c27d5

Browse files
[cherry-pick] NPU use squared_l2_norm in GradientClipByGlobalNorm (PaddlePaddle#34836) (PaddlePaddle#35289)
Co-authored-by: WangXi <[email protected]>
1 parent 52a7b0c commit 38c27d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/paddle/fluid/clip.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def _squared_l2_norm(x):
4040
This OP returns the squared L2 norm of a tensor.
4141
"""
4242

43-
if core.is_compiled_with_npu() or core.is_compiled_with_xpu():
43+
if core.is_compiled_with_xpu():
4444
square = layers.square(x)
4545
sum_square = layers.reduce_sum(square)
4646
return sum_square

0 commit comments

Comments
 (0)