Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
a162837 committed Nov 25, 2024
1 parent 5aeca47 commit 7b543b7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions python/paddle/tensor/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -3910,11 +3910,10 @@ def clip_(
"""
fmin = float(np.finfo(np.float32).min)
fmax = float(np.finfo(np.float32).max)
tensor_dtype = 'float32'

if is_clip_tensor(min) or is_clip_tensor(max):
min = check_set_clip_var(min, x, tensor_dtype, fmin, 'min')
max = check_set_clip_var(max, x, tensor_dtype, fmax, 'max')
min = check_set_clip_var(min, x, fmin, 'min')
max = check_set_clip_var(max, x, fmax, 'max')

if in_dynamic_mode():
return _C_ops.clip_tensor_(x, min, max)
Expand Down

0 comments on commit 7b543b7

Please sign in to comment.