Skip to content

Commit

Permalink
Fix for clip (ivy-llc#13067)
Browse files Browse the repository at this point in the history
  • Loading branch information
zaeemansari70 authored Mar 24, 2023
1 parent 3cef1bb commit b36fed4
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 12 deletions.
3 changes: 0 additions & 3 deletions ivy/functional/backends/jax/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,6 @@ def clip(
*,
out: Optional[JaxArray] = None,
) -> JaxArray:
ivy.utils.assertions.check_less(
x_min, x_max, message="min values must be less than max"
)
if (
hasattr(x_min, "dtype")
and hasattr(x_max, "dtype")
Expand Down
3 changes: 0 additions & 3 deletions ivy/functional/backends/numpy/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,6 @@ def clip(
*,
out: Optional[np.ndarray] = None,
) -> np.ndarray:
ivy.utils.assertions.check_less(
ivy.array(x_min), ivy.array(x_max), message="min values must be less than max"
)
return np.asarray(np.clip(x, x_min, x_max, out=out), dtype=x.dtype)


Expand Down
3 changes: 0 additions & 3 deletions ivy/functional/backends/tensorflow/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,6 @@ def clip(
*,
out: Optional[Union[tf.Tensor, tf.Variable]] = None,
) -> Union[tf.Tensor, tf.Variable]:
ivy.utils.assertions.check_less(
x_min, x_max, message="min values must be less than max"
)
if hasattr(x_min, "dtype") and hasattr(x_max, "dtype"):
promoted_type = ivy.as_native_dtype(ivy.promote_types(x.dtype, x_min.dtype))
promoted_type = ivy.as_native_dtype(
Expand Down
3 changes: 0 additions & 3 deletions ivy/functional/backends/torch/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,6 @@ def clip(
*,
out: Optional[torch.Tensor] = None,
) -> torch.Tensor:
ivy.utils.assertions.check_less(
x_min, x_max, message="min values must be less than max"
)
if hasattr(x_min, "dtype"):
promoted_type = torch.promote_types(x_min.dtype, x_max.dtype)
promoted_type = torch.promote_types(promoted_type, x.dtype)
Expand Down

0 comments on commit b36fed4

Please sign in to comment.