Skip to content

Commit

Permalink
fix static code
Browse files Browse the repository at this point in the history
  • Loading branch information
a162837 committed Oct 30, 2024
1 parent 6e4a5a8 commit b0ae16d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/paddle/tensor/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -3710,13 +3710,13 @@ def check_clip_tensor(c_x, value, re_value, value_type, name):
if value is None:
value = fill_constant([1], value_type, re_value)
else:
if isinstance(value, paddle.Tensor):
if isinstance(value, Variable, paddle.pir.Value, paddle.Tensor):
if value.shape == [0]:
raise ValueError(
f"The {name} dimension should be equal to the inner dimension of the x, but the {name} dimension is {value.shape}"
)
elif (
value.shape not in [[], [1]]
value.shape != [] and value.shape != [1]
and value.shape != c_x.shape[-len(value.shape) :]
):
raise ValueError(
Expand Down

0 comments on commit b0ae16d

Please sign in to comment.