internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: ivy-llc/ivy

Issue:
mod



Discussion:
As per documentation, tensorflow mod is an alias for floormod https://www.tensorflow.org/api_docs/python/tf/math/floormod

Resolving patch:
diff --git a/ivy/functional/frontends/tensorflow/raw_ops.py b/ivy/functional/frontends/tensorflow/raw_ops.py
--- a/ivy/functional/frontends/tensorflow/raw_ops.py
+++ b/ivy/functional/frontends/tensorflow/raw_ops.py
@@ -170,6 +170,7 @@
         )
     )
 )
+Mod = to_ivy_arrays_and_back(map_raw_ops_alias(tf_frontend.math.mod))
 Mul = to_ivy_arrays_and_back(map_raw_ops_alias(tf_frontend.math.multiply))
 Neg = to_ivy_arrays_and_back(map_raw_ops_alias(tf_frontend.math.negative))
 Pow = to_ivy_arrays_and_back(map_raw_ops_alias(tf_frontend.math.pow))


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_raw_ops.py b/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_raw_ops.py
--- a/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_raw_ops.py
+++ b/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_raw_ops.py
@@ -2911,6 +2911,38 @@ def test_tensorflow_Minimum(  # NOQA
     )
 
 
+# Mod
+@handle_frontend_test(
+    fn_tree="tensorflow.raw_ops.Mod",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float"),
+        num_arrays=2,
+        shared_dtype=True,
+    ),
+    test_with_out=st.just(False),
+)
+def test_tensorflow_Mod(  # NOQA
+    *,
+    dtype_and_x,
+    frontend,
+    test_flags,
+    fn_tree,
+    backend_fw,
+    on_device,
+):
+    input_dtype, xs = dtype_and_x
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        backend_to_test=backend_fw,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        x=xs[0],
+        y=xs[1],
+    )
+
+
 @handle_frontend_test(
     fn_tree="tensorflow.raw_ops.Mul",
     dtype_and_x=helpers.dtype_and_values(
Repository: ivy-llc/ivy

Issue:
soft_margin_loss



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/torch/nn/functional/loss_functions.py b/ivy/functional/frontends/torch/nn/functional/loss_functions.py
--- a/ivy/functional/frontends/torch/nn/functional/loss_functions.py
+++ b/ivy/functional/frontends/torch/nn/functional/loss_functions.py
@@ -542,10 +542,7 @@ def soft_margin_loss(
     reduce=None,
     reduction="mean",
 ):
-    loss = ivy.log1p(ivy.exp(-input * target))
-    reduction = _get_reduction(reduction, size_average, reduce)
-    ret = reduction(loss)
-    return ret
+    return ivy.soft_margin_loss(input, target, reduction=reduction)
 
 
 @to_ivy_arrays_and_back


Test patch:
Repository: ivy-llc/ivy

Issue:
trace



Discussion:
This issue has been labelled as stale. If you would like to continue working on this issue, then please add another comment or create a PR . If a PR has already been created which refers to this issue, then you should explicitly mention this issue in the relevant PR. For more information please refer to this page in our documentation: https://lets-unify.ai/ivy/contributing/1_the_basics.html#todo-list-issues

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/math.py b/ivy/functional/frontends/paddle/math.py
--- a/ivy/functional/frontends/paddle/math.py
+++ b/ivy/functional/frontends/paddle/math.py
@@ -567,6 +567,14 @@ def tanh(x, name=None):
     return ivy.tanh(x)
 
 
+@with_supported_dtypes(
+    {"2.5.1 and below": ("int32", "int64", "float32", "float64")}, "paddle"
+)
+@to_ivy_arrays_and_back
+def trace(x, offset=0, axis1=0, axis2=1, name=None):
+    return ivy.trace(x, offset=offset, axis1=axis1, axis2=axis2)
+
+
 @with_supported_dtypes(
     {"2.4.2 and below": ("float32", "float64", "int32", "int64")}, "paddle"
 )


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_math.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_math.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_math.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_math.py
@@ -2360,6 +2360,48 @@ def test_paddle_tanh(
     )
 
 
+# trace
+@handle_frontend_test(
+    fn_tree="paddle.trace",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float"),
+        num_arrays=1,
+        min_num_dims=2,
+        min_value=-1e04,
+        max_value=1e04,
+        allow_inf=False,
+    ),
+    offset=st.integers(min_value=-1e04, max_value=1e04),
+    axis1=st.integers(min_value=0, max_value=0),
+    axis2=st.integers(min_value=1, max_value=1),
+)
+def test_paddle_trace(
+    *,
+    dtype_and_x,
+    offset,
+    axis1,
+    axis2,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+    backend_fw,
+):
+    input_dtype, x = dtype_and_x
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        frontend=frontend,
+        test_flags=test_flags,
+        backend_to_test=backend_fw,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        x=x[0],
+        offset=offset,
+        axis1=axis1,
+        axis2=axis2,
+    )
+
+
 # trunc
 @handle_frontend_test(
     fn_tree="paddle.trunc",
Repository: ivy-llc/ivy

Issue:
one_hot



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/manipulation.py b/ivy/functional/frontends/paddle/manipulation.py
--- a/ivy/functional/frontends/paddle/manipulation.py
+++ b/ivy/functional/frontends/paddle/manipulation.py
@@ -117,6 +117,16 @@ def index_add(x, index, axis, value, *, name=None):
     return ret
 
 
+@with_supported_dtypes({"2.5.1 and below": ("int32", "int64")}, "paddle")
+@to_ivy_arrays_and_back
+def one_hot(x, num_classes, name=None):
+    if not isinstance(num_classes, int) or num_classes <= 0:
+        raise ValueError("num_classes must be a positive integer.")
+
+    one_hot_tensor = ivy.one_hot(x, num_classes)
+    return one_hot_tensor.astype(ivy.float32)
+
+
 @to_ivy_arrays_and_back
 def put_along_axis(arr, indices, values, axis, reduce="assign"):
     result = ivy.put_along_axis(arr, indices, values, axis)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_manipulation.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_manipulation.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_manipulation.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_manipulation.py
@@ -297,6 +297,39 @@ def dtypes_x_reshape(draw):
 # ------------ #
 
 
+@handle_frontend_test(
+    fn_tree="paddle.one_hot",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=["int64"],
+        min_value=0,
+        min_num_dims=1,
+        max_num_dims=5,
+    ),
+    num_classes=helpers.ints(min_value=1),
+)
+def test_one_hot(
+    *,
+    dtype_and_x,
+    num_classes,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+    backend_fw,
+):
+    input_dtype, x = dtype_and_x
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        x=x[0],
+        num_classes=num_classes,
+        backend_to_test=backend_fw,
+    )
+
+
 # abs
 @handle_frontend_test(
     fn_tree="paddle.abs",
Repository: ivy-llc/ivy

Issue:
bitwise_right_shift_



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/torch/tensor.py b/ivy/functional/frontends/torch/tensor.py
--- a/ivy/functional/frontends/torch/tensor.py
+++ b/ivy/functional/frontends/torch/tensor.py
@@ -1560,6 +1560,13 @@ def topk(self, k, dim=None, largest=True, sorted=True):
     def bitwise_right_shift(self, other, *, out=None):
         return torch_frontend.bitwise_right_shift(self._ivy_array, other)
 
+    @with_supported_dtypes(
+        {"2.0.1 and below": ("uint8", "int8", "int32", "int64")}, "torch"
+    )
+    def bitwise_right_shift_(self, other, *, out=None):
+        self.ivy_array = self.bitwise_right_shift(other, out=out).ivy_array
+        return self
+
     @with_unsupported_dtypes({"2.0.1 and below": ("float16", "bfloat16")}, "torch")
     def logdet(self):
         chol = torch_frontend.cholesky(self)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py b/ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py
--- a/ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py
+++ b/ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py
@@ -4541,6 +4541,50 @@ def test_torch_tensor_bitwise_right_shift(
     )
 
 
+# bitwise_right_shift_
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="torch.tensor",
+    method_name="bitwise_right_shift_",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("valid"),
+        num_arrays=2,
+        shared_dtype=True,
+    ),
+)
+def test_torch_tensor_bitwise_right_shift_(
+    dtype_and_x,
+    frontend_method_data,
+    init_flags,
+    method_flags,
+    frontend,
+    on_device,
+    backend_fw,
+):
+    input_dtype, x = dtype_and_x
+    # negative shifts will throw an exception
+    # shifts >= dtype witdth produce backend-defined behavior
+    x[1] = np.asarray(
+        np.clip(x[1], 0, np.iinfo(input_dtype[1]).bits - 1), dtype=input_dtype[1]
+    )
+    helpers.test_frontend_method(
+        init_input_dtypes=input_dtype,
+        backend_to_test=backend_fw,
+        init_all_as_kwargs_np={
+            "data": x[0],
+        },
+        method_input_dtypes=input_dtype,
+        method_all_as_kwargs_np={
+            "other": x[1],
+        },
+        frontend_method_data=frontend_method_data,
+        init_flags=init_flags,
+        method_flags=method_flags,
+        frontend=frontend,
+        on_device=on_device,
+    )
+
+
 # bitwise_xor
 @handle_frontend_method(
     class_tree=CLASS_TREE,
Repository: ivy-llc/ivy

Issue:
bartlett_window



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/torch/spectral_ops.py b/ivy/functional/frontends/torch/spectral_ops.py
--- a/ivy/functional/frontends/torch/spectral_ops.py
+++ b/ivy/functional/frontends/torch/spectral_ops.py
@@ -0,0 +1,31 @@
+import ivy
+from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
+
+
+@to_ivy_arrays_and_back
+def bartlett_window(
+    window_length,
+    periodic=True,
+    *,
+    dtype=None,
+    layout=None,
+    device=None,
+    requires_grad=False
+):
+    # this implementation is based on scipy.signal.windows.bartlett
+    # https://github.com/scipy/scipy/blob/v1.11.2/scipy/signal/windows/_windows.py#L625-L721
+    if int(window_length) != window_length or window_length < 0:
+        raise ValueError("Window length must be a non-negative integer")
+    elif window_length == 1:
+        return ivy.ones(window_length)
+    else:
+        N = window_length + 1 if periodic else window_length
+
+        res = ivy.arange(0, N, dtype=dtype)
+        res = ivy.where(
+            ivy.less_equal(res, (N - 1) / 2.0),
+            2.0 * res / (N - 1),
+            2.0 - 2.0 * res / (N - 1),
+        )
+
+        return res[:-1] if periodic else res


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_torch/test_spectral_ops.py b/ivy_tests/test_ivy/test_frontends/test_torch/test_spectral_ops.py
--- a/ivy_tests/test_ivy/test_frontends/test_torch/test_spectral_ops.py
+++ b/ivy_tests/test_ivy/test_frontends/test_torch/test_spectral_ops.py
@@ -0,0 +1,35 @@
+from hypothesis import strategies as st
+
+import ivy_tests.test_ivy.helpers as helpers
+from ivy_tests.test_ivy.helpers import handle_frontend_test
+
+
+@handle_frontend_test(
+    fn_tree="torch.bartlett_window",
+    window_length=helpers.ints(min_value=2, max_value=100),
+    periodic=st.booleans(),
+    dtype=helpers.get_dtypes("float", full=False),
+)
+def test_torch_bartlett_window(
+    window_length,
+    periodic,
+    dtype,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+    backend_fw,
+):
+    helpers.test_frontend_function(
+        input_dtypes=[],
+        backend_to_test=backend_fw,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        window_length=window_length,
+        periodic=periodic,
+        dtype=dtype[0],
+        rtol=1e-02,
+        atol=1e-02,
+    )
Repository: ivy-llc/ivy

Issue:
log10
#16564


Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/math.py b/ivy/functional/frontends/paddle/math.py
--- a/ivy/functional/frontends/paddle/math.py
+++ b/ivy/functional/frontends/paddle/math.py
@@ -333,6 +333,11 @@ def log1p(x, name=None):
 def log2(x, name=None):
     return ivy.log2(x)
 
+@with_supported_dtypes({"2.5.1 and below": ("float32", "float64")}, "paddle")
+@to_ivy_arrays_and_back
+def log10(x, name=None):
+    return ivy.log10(x)
+
 
 @with_unsupported_dtypes({"2.5.1 and below": ("float16", "bfloat16")}, "paddle")
 @to_ivy_arrays_and_back


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_math.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_math.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_math.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_math.py
@@ -1433,6 +1433,32 @@ def test_paddle_log2(
         x=x[0],
     )
 
+@handle_frontend_test(
+    fn_tree="paddle.log10",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("valid"),
+    ),
+)
+def test_paddle_log10(
+    *,
+    dtype_and_x,
+    on_device,
+    fn_tree,
+    frontend,
+    backend_fw,
+    test_flags,
+):
+    input_dtype, x = dtype_and_x
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        frontend=frontend,
+        backend_to_test=backend_fw,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        x=x[0],
+    )
+
 
 # logit
 @handle_frontend_test(
Repository: ivy-llc/ivy

Issue:
Replace `logging.warn()` with `logging.warning()` everywhere.
`logging.warn` has been deprecated since Python 3.3 and you should use `logging.warning`.
The two functions are functionally equivalent, but `logging.warn()` is no longer considered the preferred way to log warnings. If you are using Python 3.3 or later, you should use `logging.warning()` instead of `logging.warn()`

pylint also suggested this replacement, it can be found [here](https://pylint.readthedocs.io/en/latest/user_guide/messages/warning/deprecated-method.html).


Discussion:

Resolving patch:
diff --git a/ivy/functional/backends/tensorflow/__init__.py b/ivy/functional/backends/tensorflow/__init__.py
--- a/ivy/functional/backends/tensorflow/__init__.py
+++ b/ivy/functional/backends/tensorflow/__init__.py
@@ -7,7 +7,7 @@
     try:
         tf.config.experimental.set_memory_growth(device, True)
     except RuntimeError as e:
-        logging.warn(f"can not set {device} to dynamically allocate memory. {e}")
+        logging.warning(f"can not set {device} to dynamically allocate memory. {e}")
 
 
 from tensorflow.python.framework.dtypes import DType
diff --git a/ivy/utils/backend/sub_backend_handler.py b/ivy/utils/backend/sub_backend_handler.py
--- a/ivy/utils/backend/sub_backend_handler.py
+++ b/ivy/utils/backend/sub_backend_handler.py
@@ -51,11 +51,11 @@
 
 def set_sub_backend(sub_backend_str: str):
     if ivy.backend == "":
-        logging.warn("You must set a backend first")
+        logging.warning("You must set a backend first")
         return
 
     if ivy.current_backend_str() not in _backend_to_sub_backends_dict.keys():
-        logging.warn(
+        logging.warning(
             f"backend {ivy.current_backend_str()} does not have any"
             " supported sub_backends"
         )
@@ -68,7 +68,7 @@ def set_sub_backend(sub_backend_str: str):
         )
 
     if sub_backend_str not in _backend_to_sub_backends_dict[ivy.current_backend_str()]:
-        logging.warn(
+        logging.warning(
             f"{ivy.current_backend_str()} does not support"
             f" {sub_backend_str} as a sub_backend"
         )
diff --git a/ivy/utils/profiler.py b/ivy/utils/profiler.py
--- a/ivy/utils/profiler.py
+++ b/ivy/utils/profiler.py
@@ -50,7 +50,7 @@ def __exit__(self, *exc):
                         stats.dump_stats(filename=f.name)
                         subprocess.run(["snakeviz", f"{f.name}"])
                 else:
-                    logging.warn("snakeviz must be installed for visualization")
+                    logging.warning("snakeviz must be installed for visualization")
 
             if self.print_stats:
                 stats.print_stats()


Test patch:
Repository: ivy-llc/ivy

Issue:
rfft



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/jax/numpy/fft.py b/ivy/functional/frontends/jax/numpy/fft.py
--- a/ivy/functional/frontends/jax/numpy/fft.py
+++ b/ivy/functional/frontends/jax/numpy/fft.py
@@ -48,3 +48,19 @@ def ifft2(a, s=None, axes=(-2, -1), norm=None):
     if norm is None:
         norm = "backward"
     return ivy.array(ivy.ifft2(a, s=s, dim=axes, norm=norm), dtype=ivy.dtype(a))
+
+
+@to_ivy_arrays_and_back
+@with_unsupported_dtypes({"1.25.2 and below": ("float16", "bfloat16")}, "numpy")
+def rfft(a, n=None, axis=-1, norm=None):
+    if n is None:
+        n = a.shape[axis]
+    if norm is None:
+        norm = "backward"
+    result = ivy.dft(
+        a, axis=axis, inverse=False, onesided=False, dft_length=n, norm=norm
+    )
+    slices = [slice(0, a) for a in result.shape]
+    slices[axis] = slice(0, int(ivy.shape(result, as_array=True)[axis] // 2 + 1))
+    result = result[tuple(slices)]
+    return result


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_fft.py b/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_fft.py
--- a/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_fft.py
+++ b/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_fft.py
@@ -214,3 +214,46 @@ def test_jax_numpy_ifft2(
         atol=1e-02,
         rtol=1e-02,
     )
+
+
+# rfft
+@handle_frontend_test(
+    fn_tree="jax.numpy.fft.rfft",
+    dtype_input_axis=helpers.dtype_values_axis(
+        available_dtypes=helpers.get_dtypes("float"),
+        num_arrays=1,
+        min_value=-1e5,
+        max_value=1e5,
+        min_num_dims=1,
+        min_dim_size=2,
+        allow_inf=False,
+        large_abs_safety_factor=2.5,
+        small_abs_safety_factor=2.5,
+        safety_factor_scale="log",
+        valid_axis=True,
+        force_int_axis=True,
+    ),
+    n=st.one_of(
+        st.integers(min_value=2, max_value=10),
+        st.just(None),
+    ),
+    norm=st.sampled_from(["backward", "ortho", "forward", None]),
+)
+def test_jax_numpy_rfft(
+    dtype_input_axis, n, norm, frontend, backend_fw, test_flags, fn_tree, on_device
+):
+    input_dtype, x, axis = dtype_input_axis
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        frontend=frontend,
+        backend_to_test=backend_fw,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        a=x[0],
+        n=n,
+        axis=axis,
+        norm=norm,
+        atol=1e-04,
+        rtol=1e-04,
+    )
Repository: ivy-llc/ivy

Issue:
smooth_l1_loss



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/torch/nn/functional/loss_functions.py b/ivy/functional/frontends/torch/nn/functional/loss_functions.py
--- a/ivy/functional/frontends/torch/nn/functional/loss_functions.py
+++ b/ivy/functional/frontends/torch/nn/functional/loss_functions.py
@@ -508,29 +508,7 @@ def smooth_l1_loss(
     reduction="mean",
     beta=1.0,
 ):
-    beta = ivy.array(beta, device=input.device)
-    reduction = _get_reduction(reduction, size_average, reduce)
-
-    if beta < 1e-5:
-        # [Copied and modified from fvcore]
-        # if beta == 0, then torch.where will result in nan gradients when
-        # the chain rule is applied due to pytorch implementation details
-        # (the False branch "0.5 * _diff_abs ** 2 / 0" has an incoming
-        # gradient of zeros, rather than "no gradient"). To avoid this
-        # issue, we define small values of beta to be exactly l1 loss.
-        loss = ivy.abs(input - target)
-    else:
-        _diff_abs = ivy.abs(input - target)
-
-        loss = ivy.where(
-            _diff_abs < beta,
-            0.5 * _diff_abs**2 / beta,
-            _diff_abs - 0.5 * beta,
-        )
-
-    ret = reduction(loss)
-
-    return ret
+    return ivy.smooth_l1_loss(input, target, beta=beta, reduction=reduction)
 
 
 @to_ivy_arrays_and_back


Test patch:
Repository: ivy-llc/ivy

Issue:
__ilshift__



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/numpy/ndarray/ndarray.py b/ivy/functional/frontends/numpy/ndarray/ndarray.py
--- a/ivy/functional/frontends/numpy/ndarray/ndarray.py
+++ b/ivy/functional/frontends/numpy/ndarray/ndarray.py
@@ -723,3 +723,6 @@ def _unsigned_int_bytes_repr(item_val, /, *, dtype=None):
             return b"".join(bytes_reprs)
         else:
             raise ValueError("Unsupported data type for the array.")
+
+    def __ilshift__(self, value, /):
+        return ivy.bitwise_left_shift(self.ivy_array, value, out=self)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_numpy/test_ndarray/test_ndarray.py b/ivy_tests/test_ivy/test_frontends/test_numpy/test_ndarray/test_ndarray.py
--- a/ivy_tests/test_ivy/test_frontends/test_numpy/test_ndarray/test_ndarray.py
+++ b/ivy_tests/test_ivy/test_frontends/test_numpy/test_ndarray/test_ndarray.py
@@ -3671,3 +3671,54 @@ def test_numpy_ndarray_view(
         frontend_method_data=frontend_method_data,
         on_device=on_device,
     )
+
+
+#__ilshift__
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="numpy.array",
+    method_name="__ilshift__",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("integer"),
+        num_arrays=2,
+        max_dim_size=1,
+        max_value=2**31 - 1,
+    ),
+)
+def test_numpy_instance_ilshift__(
+    dtype_and_x,
+    frontend_method_data,
+    init_flags,
+    method_flags,
+    frontend,
+    backend_fw,
+    on_device,
+):
+    input_dtypes, x = dtype_and_x
+    max_bits = np.iinfo(input_dtypes[0]).bits
+    max_shift = max_bits - 1
+    x[1] = np.asarray(np.clip(x[1], 0, max_shift), dtype=input_dtypes[1])
+    max_value_before_shift = 2 ** (max_bits - x[1]) - 1
+    overflow_threshold = 2 ** (max_bits - 1)
+    x[0] = np.asarray(
+        np.clip(x[0], None, max_value_before_shift), dtype=input_dtypes[0]
+    )
+    if np.any(x[0] > overflow_threshold):
+        x[0] = np.clip(x[0], None, overflow_threshold)
+    if np.any(x[0] < 0):
+        x[0] = np.abs(x[0])
+    helpers.test_frontend_method(
+        init_input_dtypes=input_dtypes,
+        init_all_as_kwargs_np={
+            "object": x[0],
+        },
+        backend_to_test=backend_fw,
+        method_all_as_kwargs_np={
+            "value": x[1],
+        },
+        frontend=frontend,
+        frontend_method_data=frontend_method_data,
+        init_flags=init_flags,
+        method_flags=method_flags,
+        on_device=on_device,
+    )