Skip to content

Commit b94660c

Browse files
Fix out support for clip
1 parent 91ccd42 commit b94660c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/paddle/tensor/math.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3887,7 +3887,7 @@ def clip(
38873887
max = max.item(0)
38883888
if isinstance(min, float) or isinstance(max, float):
38893889
x = paddle.cast(x, paddle.float32)
3890-
return _C_ops.clip(x, min, max)
3890+
return _C_ops.clip(x, min, max, out=out)
38913891
elif in_pir_mode():
38923892
if x_dtype in ['paddle.int32', 'paddle.int64']:
38933893
if (
@@ -3903,7 +3903,7 @@ def clip(
39033903
)
39043904
):
39053905
x = paddle.cast(x, paddle.float32)
3906-
return _C_ops.clip(x, min, max)
3906+
return _C_ops.clip(x, min, max, out=out)
39073907
else:
39083908
if min is not None:
39093909
check_type(min, 'min', (float, int, Variable), 'clip')

0 commit comments

Comments
 (0)