From 96632f669139982ff786f82c4584df130c4862b4 Mon Sep 17 00:00:00 2001 From: a162837 <1628373140@qq.com> Date: Tue, 5 Nov 2024 14:06:19 +0800 Subject: [PATCH] fix code --- python/paddle/tensor/math.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/paddle/tensor/math.py b/python/paddle/tensor/math.py index db11e99a2b9a43..6be0c3988612f2 100644 --- a/python/paddle/tensor/math.py +++ b/python/paddle/tensor/math.py @@ -3831,9 +3831,9 @@ def clip( else: if in_dynamic_or_pir_mode(): - if isinstance(min, Variable, paddle.pir.Value): + if isinstance(min, (Variable, paddle.pir.Value)): min = min.item() - if isinstance(max, Variable, paddle.pir.Value): + if isinstance(max, (Variable, paddle.pir.Value)): max = max.item() min = min_ if min is None else min max = max_ if max is None else max