Skip to content

Commit

Permalink
fix: setting min and max as default None in ivy.clip (#23956)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShreyanshBardia authored Sep 21, 2023
1 parent 467f44e commit 45ef9da
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions ivy/data_classes/array/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,8 @@ def stack(

def clip(
self: ivy.Array,
x_min: Union[Number, ivy.Array, ivy.NativeArray],
x_max: Union[Number, ivy.Array, ivy.NativeArray],
x_min: Optional[Union[Number, ivy.Array, ivy.NativeArray]] = None,
x_max: Optional[Union[Number, ivy.Array, ivy.NativeArray]] = None,
/,
*,
out: Optional[ivy.Array] = None,
Expand Down
2 changes: 1 addition & 1 deletion ivy/functional/backends/jax/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ def tile(

def clip(
x: JaxArray,
/,
x_min: Optional[Union[Number, JaxArray]] = None,
x_max: Optional[Union[Number, JaxArray]] = None,
/,
*,
out: Optional[JaxArray] = None,
) -> JaxArray:
Expand Down
4 changes: 2 additions & 2 deletions ivy/functional/backends/numpy/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,9 @@ def unstack(

def clip(
x: np.ndarray,
x_min: Union[Number, np.ndarray],
x_max: Union[Number, np.ndarray],
/,
x_min: Optional[Union[Number, np.ndarray]] = None,
x_max: Optional[Union[Number, np.ndarray]] = None,
*,
out: Optional[np.ndarray] = None,
) -> np.ndarray:
Expand Down
4 changes: 2 additions & 2 deletions ivy/functional/backends/paddle/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,9 +438,9 @@ def swapaxes(

def clip(
x: paddle.Tensor,
x_min: Union[Number, paddle.Tensor],
x_max: Union[Number, paddle.Tensor],
/,
x_min: Optional[Union[Number, paddle.Tensor]] = None,
x_max: Optional[Union[Number, paddle.Tensor]] = None,
*,
out: Optional[paddle.Tensor] = None,
) -> paddle.Tensor:
Expand Down
4 changes: 2 additions & 2 deletions ivy/functional/backends/tensorflow/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,9 @@ def swapaxes(
@with_unsupported_dtypes({"2.13.0 and below": ("complex",)}, backend_version)
def clip(
x: Union[tf.Tensor, tf.Variable],
x_min: Union[Number, tf.Tensor, tf.Variable],
x_max: Union[Number, tf.Tensor, tf.Variable],
/,
x_min: Optional[Union[Number, tf.Tensor, tf.Variable]] = None,
x_max: Optional[Union[Number, tf.Tensor, tf.Variable]] = None,
*,
out: Optional[Union[tf.Tensor, tf.Variable]] = None,
) -> Union[tf.Tensor, tf.Variable]:
Expand Down
4 changes: 2 additions & 2 deletions ivy/functional/backends/torch/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,9 @@ def swapaxes(
)
def clip(
x: torch.Tensor,
x_min: Union[Number, torch.Tensor],
x_max: Union[Number, torch.Tensor],
/,
x_min: Optional[Union[Number, torch.Tensor]] = None,
x_max: Optional[Union[Number, torch.Tensor]] = None,
*,
out: Optional[torch.Tensor] = None,
) -> torch.Tensor:
Expand Down
4 changes: 2 additions & 2 deletions ivy/functional/ivy/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -863,9 +863,9 @@ def stack(
@handle_device_shifting
def clip(
x: Union[ivy.Array, ivy.NativeArray],
x_min: Union[Number, ivy.Array, ivy.NativeArray],
x_max: Union[Number, ivy.Array, ivy.NativeArray],
/,
x_min: Optional[Union[Number, ivy.Array, ivy.NativeArray]] = None,
x_max: Optional[Union[Number, ivy.Array, ivy.NativeArray]] = None,
*,
out: Optional[ivy.Array] = None,
) -> ivy.Array:
Expand Down

0 comments on commit 45ef9da

Please sign in to comment.