diff --git a/python/paddle/fluid/clip.py b/python/paddle/fluid/clip.py index 04fb45cd3ae22d16c4a64d05f225ce32dbee9862..d48cea48a76fd41d3c431f1467697ac815439932 100644 --- a/python/paddle/fluid/clip.py +++ b/python/paddle/fluid/clip.py @@ -40,7 +40,7 @@ def _squared_l2_norm(x): This OP returns the squared L2 norm of a tensor. """ - if core.is_compiled_with_npu() or core.is_compiled_with_xpu(): + if core.is_compiled_with_xpu(): square = layers.square(x) sum_square = layers.reduce_sum(square) return sum_square