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

Issue:
exp



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
@@ -754,7 +754,7 @@ def bitwise_and_(self, other):
     def atan2_(self, other):
         self._ivy_array = self.atan2(other).ivy_array
         return self
-    
+
     def fmin(self, other, out=None):
         return torch_frontend.fmin(self._ivy_array, other, out=out)
 
@@ -883,3 +883,7 @@ def bitwise_xor(self, other, *, out=None):
     @with_unsupported_dtypes({"1.11.0 and below": ("float16",)}, "torch")
     def cumprod(self, dim, dtype):
         return torch_frontend.cumprod(self._ivy_array, dim, dtype=dtype)
+
+    @with_unsupported_dtypes({"1.11.0 and below": ("bfloat16",)}, "torch")
+    def exp(self, *, out=None):
+        return torch_frontend.exp(self._ivy_array)


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
@@ -5843,6 +5843,7 @@ def test_torch_instance_bitwise_xor(
         on_device=on_device,
     )
 
+
 # cumprod
 @handle_frontend_method(
     class_tree=CLASS_TREE,
@@ -5956,3 +5957,36 @@ def test_torch_instance_fmin(
         frontend=frontend,
         on_device=on_device,
     )
+
+
+# exp
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="torch.tensor",
+    method_name="exp",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("numeric"),
+    ),
+)
+def test_torch_instance_exp(
+    dtype_and_x,
+    frontend_method_data,
+    init_flags,
+    method_flags,
+    frontend,
+    on_device,
+):
+    input_dtype, x = dtype_and_x
+    helpers.test_frontend_method(
+        init_input_dtypes=input_dtype,
+        init_all_as_kwargs_np={
+            "data": x[0],
+        },
+        method_input_dtypes=input_dtype,
+        method_all_as_kwargs_np={},
+        frontend_method_data=frontend_method_data,
+        init_flags=init_flags,
+        method_flags=method_flags,
+        frontend=frontend,
+        on_device=on_device,
+    )
Repository: ivy-llc/ivy

Issue:
fmin



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
@@ -754,6 +754,9 @@ def bitwise_and_(self, other):
     def atan2_(self, other):
         self._ivy_array = self.atan2(other).ivy_array
         return self
+    
+    def fmin(self, other, out=None):
+        return torch_frontend.fmin(self._ivy_array, other, out=out)
 
     # Special Methods #
     # -------------------#


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
@@ -5843,7 +5843,6 @@ def test_torch_instance_bitwise_xor(
         on_device=on_device,
     )
 
-
 # cumprod
 @handle_frontend_method(
     class_tree=CLASS_TREE,
@@ -5921,3 +5920,39 @@ def test_torch_instance_relu(
         frontend=frontend,
         on_device=on_device,
     )
+
+
+# fmin
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="torch.tensor",
+    method_name="fmin",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float"),
+        num_arrays=2,
+    ),
+)
+def test_torch_instance_fmin(
+    dtype_and_x,
+    frontend_method_data,
+    init_flags,
+    method_flags,
+    frontend,
+    on_device,
+):
+    input_dtype, x = dtype_and_x
+    helpers.test_frontend_method(
+        init_input_dtypes=input_dtype,
+        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,
+    )
Repository: ivy-llc/ivy

Issue:
triu_indices_from



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/jax/numpy/indexing.py b/ivy/functional/frontends/jax/numpy/indexing.py
--- a/ivy/functional/frontends/jax/numpy/indexing.py
+++ b/ivy/functional/frontends/jax/numpy/indexing.py
@@ -33,5 +33,13 @@ def tril_indices(n_rows, n_cols=None, k=0):
 
 
 @to_ivy_arrays_and_back
+def triu_indices(n, k=0, m=None):
+    return ivy.triu_indices(n, m, k)
+
+@to_ivy_arrays_and_back
+def triu_indices_from(arr, k=0):
+    return ivy.triu_indices(arr.shape[-2], arr.shape[-1], k)
+
 def tril_indices_from(arr, k=0):
     return ivy.tril_indices(arr.shape[-2], arr.shape[-1], k)
+


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_numpy_indexing.py b/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_numpy_indexing.py
--- a/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_numpy_indexing.py
+++ b/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_numpy_indexing.py
@@ -202,6 +202,66 @@ def test_jax_numpy_tril_indices(
     )
 
 
+
+# triu_indices
+@handle_frontend_test(
+    fn_tree="jax.numpy.triu_indices",
+    n=helpers.ints(min_value=2, max_value=10),
+    k=helpers.ints(min_value=-10, max_value=10),
+    input_dtypes=helpers.get_dtypes("valid", full=False),
+    test_with_out=st.just(False),
+)
+def test_jax_numpy_triu_indices(
+    n,
+    k,
+    input_dtypes,
+    test_flags,
+    frontend,
+    fn_tree,
+    on_device,
+):
+    helpers.test_frontend_function(
+        n=n,
+        k=k,
+        input_dtypes=input_dtypes,
+        test_flags=test_flags,
+        frontend=frontend,
+        fn_tree=fn_tree,
+        on_device=on_device,
+    )
+
+# triu_indices_from
+@handle_frontend_test(
+    fn_tree="jax.numpy.triu_indices_from",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("numeric"),
+        num_arrays=1,
+        min_num_dims=2,
+        max_num_dims=5,
+    ),
+    k=helpers.ints(min_value=-5, max_value=5),
+    test_with_out=st.just(False),
+)
+
+def test_jax_numpy_triu_indices_from(
+    dtype_and_x,
+    k,
+    test_flags,
+    frontend,
+    fn_tree,
+    on_device,
+):
+    dtype, x = dtype_and_x
+    helpers.test_frontend_function(
+        input_dtypes=dtype,
+        test_flags=test_flags,
+        frontend=frontend,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        arr=x[0],
+        k=k,
+    )
+    
 # tril_indices_from
 @handle_frontend_test(
     fn_tree="jax.numpy.tril_indices_from",
@@ -214,6 +274,7 @@ def test_jax_numpy_tril_indices(
     k=helpers.ints(min_value=-5, max_value=5),
     test_with_out=st.just(False),
 )
+
 def test_jax_numpy_tril_indices_from(
     dtype_and_x,
     k,
Repository: ivy-llc/ivy

Issue:
tril_indces_from



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/jax/numpy/indexing.py b/ivy/functional/frontends/jax/numpy/indexing.py
--- a/ivy/functional/frontends/jax/numpy/indexing.py
+++ b/ivy/functional/frontends/jax/numpy/indexing.py
@@ -30,3 +30,8 @@ def take_along_axis(arr, indices, axis, mode="fill"):
 @to_ivy_arrays_and_back
 def tril_indices(n_rows, n_cols=None, k=0):
     return ivy.tril_indices(n_rows, n_cols, k)
+
+
+@to_ivy_arrays_and_back
+def tril_indices_from(arr, k=0):
+    return ivy.tril_indices(arr.shape[-2], arr.shape[-1], k)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_numpy_indexing.py b/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_numpy_indexing.py
--- a/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_numpy_indexing.py
+++ b/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_numpy_indexing.py
@@ -148,7 +148,7 @@ def test_jax_numpy_diag_indices(
         indices_same_dims=True,
         valid_bounds=False,
     ),
-    mode=st.sampled_from(['clip', 'fill', 'drop']),
+    mode=st.sampled_from(["clip", "fill", "drop"]),
     test_with_out=st.just(False),
 )
 def test_jax_numpy_take_along_axis(
@@ -200,3 +200,35 @@ def test_jax_numpy_tril_indices(
         n_rows=n_rows,
         k=k,
     )
+
+
+# tril_indices_from
+@handle_frontend_test(
+    fn_tree="jax.numpy.tril_indices_from",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("numeric"),
+        num_arrays=1,
+        min_num_dims=2,
+        max_num_dims=5,
+    ),
+    k=helpers.ints(min_value=-5, max_value=5),
+    test_with_out=st.just(False),
+)
+def test_jax_numpy_tril_indices_from(
+    dtype_and_x,
+    k,
+    test_flags,
+    frontend,
+    fn_tree,
+    on_device,
+):
+    dtype, x = dtype_and_x
+    helpers.test_frontend_function(
+        input_dtypes=dtype,
+        test_flags=test_flags,
+        frontend=frontend,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        arr=x[0],
+        k=k,
+    )
Repository: ivy-llc/ivy

Issue:
squeeze



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/jax/lax/operators.py b/ivy/functional/frontends/jax/lax/operators.py
--- a/ivy/functional/frontends/jax/lax/operators.py
+++ b/ivy/functional/frontends/jax/lax/operators.py
@@ -535,6 +535,11 @@ def top_k(operand, k):
     return [values, indices]
 
 
+@to_ivy_arrays_and_back
+def squeeze(array, dimensions):
+    return ivy.squeeze(array, dimensions)
+
+
 @to_ivy_arrays_and_back
 def real(x):
     return ivy.real(x)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_lax_operators.py b/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_lax_operators.py
--- a/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_lax_operators.py
+++ b/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_lax_operators.py
@@ -2334,3 +2334,48 @@ def test_jax_lax_real(
         test_values=True,
         x=x[0],
     )
+
+
+# squeeze
+@st.composite
+def _squeeze_helper(draw):
+    shape = draw(st.shared(helpers.get_shape(), key="value_shape"))
+    valid_axes = []
+    for index, axis in enumerate(shape):
+        if axis == 1:
+            valid_axes.append(index)
+    return valid_axes
+
+
+@handle_frontend_test(
+    fn_tree="jax.lax.squeeze",
+    dtype_and_values=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float"),
+        shape=st.shared(helpers.get_shape(
+            allow_none=False,
+            min_num_dims=1,
+            max_num_dims=10,
+            min_dim_size=1,
+            max_dim_size=5), key="value_shape")
+    ),
+    dim=_squeeze_helper(),
+)
+def test_jax_lax_squeeze(
+    *,
+    dtype_and_values,
+    dim,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+):
+    input_dtype, value = dtype_and_values
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        array=value[0],
+        dimensions=dim,
+    )
Repository: ivy-llc/ivy

Issue:
logsumexp



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/torch/reduction_ops.py b/ivy/functional/frontends/torch/reduction_ops.py
--- a/ivy/functional/frontends/torch/reduction_ops.py
+++ b/ivy/functional/frontends/torch/reduction_ops.py
@@ -182,3 +182,19 @@ def quantile(input, q, dim=None, keepdim=False, *, interpolation="linear", out=N
 @to_ivy_arrays_and_back
 def count_nonzero(input, dim=None):
     return ivy.count_nonzero(input, axis=dim).astype(ivy.int64)
+
+
+@to_ivy_arrays_and_back
+def logsumexp(input, dim, keepdim=False, *, out=None):
+    c = ivy.max(input, axis=dim, keepdims=True)
+    if ivy.get_num_dims(c) > 0:
+        c = ivy.where(ivy.isinf(c), ivy.zeros_like(c), c)
+    elif not ivy.isinf(c):
+        c = 0
+    exponential = ivy.exp(input - c)
+    sum = ivy.sum(exponential, axis=dim, keepdims=keepdim)
+    ret = ivy.log(sum)
+    if not keepdim:
+        c = ivy.squeeze(c, axis=dim)
+    ret = ivy.add(ret, c, out=out)
+    return ret


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_torch/test_reduction_ops.py b/ivy_tests/test_ivy/test_frontends/test_torch/test_reduction_ops.py
--- a/ivy_tests/test_ivy/test_frontends/test_torch/test_reduction_ops.py
+++ b/ivy_tests/test_ivy/test_frontends/test_torch/test_reduction_ops.py
@@ -729,3 +729,38 @@ def test_torch_count_nonzero(
         input=x[0],
         dim=axis,
     )
+
+
+@handle_frontend_test(
+    fn_tree="torch.logsumexp",
+    dtype_input_axis=helpers.dtype_values_axis(
+        available_dtypes=helpers.get_dtypes("numeric"),
+        min_value=-50,
+        max_value=50,
+        min_num_dims=1,
+        max_num_dims=5,
+        valid_axis=True,
+        force_int_axis=True,
+    ),
+    keepdims=st.booleans(),
+)
+def test_torch_logsumexp(
+    *,
+    dtype_input_axis,
+    keepdims,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+):
+    input_dtype, x, axis = dtype_input_axis
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        input=x[0],
+        dim=axis,
+        keepdim=keepdims,
+    )
Repository: ivy-llc/ivy

Issue:
not_equal



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/tensorflow/math.py b/ivy/functional/frontends/tensorflow/math.py
--- a/ivy/functional/frontends/tensorflow/math.py
+++ b/ivy/functional/frontends/tensorflow/math.py
@@ -402,6 +402,12 @@ def equal(x, y, name=None):
     return ivy.equal(x, y)
 
 
+@to_ivy_arrays_and_back
+def not_equal(x, y, name=None):
+    x, y = check_tensorflow_casting(x, y)
+    return ivy.not_equal(x, y)
+
+
 @to_ivy_arrays_and_back
 def floor(x, name=None):
     return ivy.floor(x)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_math.py b/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_math.py
--- a/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_math.py
+++ b/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_math.py
@@ -1310,6 +1310,36 @@ def test_tensorflow_equal(
     )
 
 
+# not_equal
+@handle_frontend_test(
+    fn_tree="tensorflow.math.not_equal",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("numeric"),
+        num_arrays=2,
+        shared_dtype=True,
+    ),
+    test_with_out=st.just(False),
+)
+def test_tensorflow_not_equal(
+    *,
+    dtype_and_x,
+    frontend,
+    test_flags,
+    fn_tree,
+    on_device,
+):
+    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],
+        y=x[1],
+    )
+
+
 # floor
 @handle_frontend_test(
     fn_tree="tensorflow.math.floor",
@@ -1823,10 +1853,10 @@ def test_tensorflow_floormod(
         fn_tree=fn_tree,
         on_device=on_device,
         x=x[0],
-        y=x[1], 
+        y=x[1],
     )
 
-    
+
 # greater
 @handle_frontend_test(
     fn_tree="tensorflow.math.greater",
Repository: ivy-llc/ivy

Issue:
median
Implement median reduction operation for the PyTorch frontend.


Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/torch/reduction_ops.py b/ivy/functional/frontends/torch/reduction_ops.py
--- a/ivy/functional/frontends/torch/reduction_ops.py
+++ b/ivy/functional/frontends/torch/reduction_ops.py
@@ -62,6 +62,11 @@ def nanmean(input, dim=None, keepdim=False, *, dtype=None, out=None):
     return ivy.nanmean(input, axis=dim, keepdims=keepdim, dtype=dtype, out=out)
 
 
+@to_ivy_arrays_and_back
+def median(input, dim=-1, keepdim=False, *, out=None):
+    return ivy.median(input, axis=dim, keepdims=keepdim, out=out)
+
+
 @to_ivy_arrays_and_back
 def std(input, dim, unbiased, keepdim=False, *, out=None):
     return ivy.std(input, axis=dim, correction=int(unbiased), keepdims=keepdim, out=out)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_torch/test_reduction_ops.py b/ivy_tests/test_ivy/test_frontends/test_torch/test_reduction_ops.py
--- a/ivy_tests/test_ivy/test_frontends/test_torch/test_reduction_ops.py
+++ b/ivy_tests/test_ivy/test_frontends/test_torch/test_reduction_ops.py
@@ -335,6 +335,37 @@ def test_torch_nanmean(
     )
 
 
+@handle_frontend_test(
+    fn_tree="torch.median",
+    dtype_and_x=statistical_dtype_values(
+        function="median",
+        min_value=-1e04,
+        max_value=1e04,
+    ),
+    keepdims=st.booleans(),
+)
+def test_torch_median(
+    *,
+    dtype_and_x,
+    keepdims,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags
+):
+    input_dtype, x, axis = 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,
+        input=x[0],
+        dim=axis,
+        keepdim=keepdims
+    )
+
+
 @handle_frontend_test(
     fn_tree="torch.std",
     dtype_and_x=statistical_dtype_values(function="std"),
Repository: ivy-llc/ivy

Issue:
iscomplexobj
Was mentioned here #11223, but it's open for almost a month now 😅


Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/jax/numpy/logic.py b/ivy/functional/frontends/jax/numpy/logic.py
--- a/ivy/functional/frontends/jax/numpy/logic.py
+++ b/ivy/functional/frontends/jax/numpy/logic.py
@@ -209,3 +209,14 @@ def isrealobj(x: any):
 @to_ivy_arrays_and_back
 def iscomplex(x: any):
     return ivy.bitwise_invert(ivy.isreal(x))
+
+
+@to_ivy_arrays_and_back
+def iscomplexobj(x):
+    if x.ndim == 0:
+        return ivy.is_complex_dtype(ivy.dtype(x))
+    for ele in x:
+        if ivy.is_complex_dtype(ivy.dtype(ele)):
+            return True
+        else:
+            return False
\ No newline at end of file


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_numpy_logic.py b/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_numpy_logic.py
--- a/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_numpy_logic.py
+++ b/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_numpy_logic.py
@@ -938,3 +938,30 @@ def test_jax_numpy_isrealobj(
         on_device=on_device,
         x=x[0],
     )
+
+
+# iscomplexobj
+@handle_frontend_test(
+    fn_tree="jax.numpy.iscomplexobj",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("valid"),
+    ),
+    test_with_out=st.just(False),
+)
+def test_jax_numpy_iscomplexobj(
+    dtype_and_x,
+    frontend,
+    on_device,
+    *,
+    fn_tree,
+    test_flags,
+):
+    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],
+    )
Repository: ivy-llc/ivy

Issue:
iscomplex
Marked as closed in #10862, yet it's unimplemented.


Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/jax/numpy/logic.py b/ivy/functional/frontends/jax/numpy/logic.py
--- a/ivy/functional/frontends/jax/numpy/logic.py
+++ b/ivy/functional/frontends/jax/numpy/logic.py
@@ -205,3 +205,7 @@ def right_shift(x1, x2, /):
 def isrealobj(x: any):
     return not ivy.is_complex_dtype(ivy.dtype(x))
 
+
+@to_ivy_arrays_and_back
+def iscomplex(x: any):
+    return ivy.bitwise_invert(ivy.isreal(x))


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_numpy_logic.py b/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_numpy_logic.py
--- a/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_numpy_logic.py
+++ b/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_numpy_logic.py
@@ -887,6 +887,33 @@ def test_jax_numpy_right_shift(
     )
 
 
+# iscomplex
+@handle_frontend_test(
+    fn_tree="jax.numpy.iscomplex",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("real_and_complex"), min_num_dims=1
+    ),
+    test_with_out=st.just(False),
+)
+def test_jax_numpy_iscomplex(
+    dtype_and_x,
+    frontend,
+    on_device,
+    *,
+    fn_tree,
+    test_flags,
+):
+    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],
+    )
+
+
 @handle_frontend_test(
     fn_tree="jax.numpy.isrealobj",
     dtype_and_x=helpers.dtype_and_values(
Repository: ivy-llc/ivy

Issue:
fill_diagonal



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/numpy/indexing_routines/indexing_like_operations.py b/ivy/functional/frontends/numpy/indexing_routines/indexing_like_operations.py
--- a/ivy/functional/frontends/numpy/indexing_routines/indexing_like_operations.py
+++ b/ivy/functional/frontends/numpy/indexing_routines/indexing_like_operations.py
@@ -54,3 +54,29 @@ def indices(dimensions, dtype=int, sparse=False):
 def unravel_index(indices, shape, order="C"):
     ret = [x.astype("int64") for x in ivy.unravel_index(indices, shape)]
     return tuple(ret)
+
+
+@to_ivy_arrays_and_back
+def fill_diagonal(a, val, wrap=False):
+    if a.ndim < 2:
+        raise ValueError("array must be at least 2-d")
+    end = None
+    if a.ndim == 2:
+        # Explicit, fast formula for the common case.  For 2-d arrays, we
+        # accept rectangular ones.
+        step = a.shape[1] + 1
+        # This is needed to don't have tall matrix have the diagonal wrap.
+        if not wrap:
+            end = a.shape[1] * a.shape[1]
+    else:
+        # For more than d=2, the strided formula is only valid for arrays with
+        # all dimensions equal, so we check first.
+        if not ivy.all(ivy.diff(a.shape) == 0):
+            raise ValueError("All dimensions of input must be of equal length")
+        step = 1 + ivy.sum(ivy.cumprod(a.shape[:-1]))
+
+    # Write the value out into the diagonal.
+    shape = a.shape
+    a = ivy.reshape(a, a.size)
+    a[:end:step] = val
+    a = ivy.reshape(a, shape)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_numpy/test_indexing_routines/test_indexing_like_operations.py b/ivy_tests/test_ivy/test_frontends/test_numpy/test_indexing_routines/test_indexing_like_operations.py
--- a/ivy_tests/test_ivy/test_frontends/test_numpy/test_indexing_routines/test_indexing_like_operations.py
+++ b/ivy_tests/test_ivy/test_frontends/test_numpy/test_indexing_routines/test_indexing_like_operations.py
@@ -238,3 +238,38 @@ def test_numpy_unravel_index(
         indices=x[0],
         shape=shape,
     )
+
+ 
+@handle_frontend_test(
+    fn_tree="numpy.fill_diagonal",
+    dtype_x_axis=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float"),
+        min_num_dims=2,
+        min_dim_size=2,
+        max_num_dims=2,
+
+    ),
+    val=helpers.floats(),
+    wrap=helpers.get_dtypes(kind="bool"),
+    test_with_out=st.just(False),
+)
+def test_numpy_fill_diagonal(
+    dtype_x_axis,
+    wrap,
+    val,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+):
+    input_dtype, x = dtype_x_axis
+    np_frontend_helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        on_device=on_device,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        a=x[0],
+        val=val,
+        wrap=wrap
+    )