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

Issue:
min



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/jax/devicearray.py b/ivy/functional/frontends/jax/devicearray.py
--- a/ivy/functional/frontends/jax/devicearray.py
+++ b/ivy/functional/frontends/jax/devicearray.py
@@ -273,6 +273,19 @@ def __iter__(self):
     def round(self, decimals=0):
         return jax_frontend.numpy.round(self, decimals)
 
+    def min(
+        self,
+        /,
+        *,
+        axis=None,
+        out=None,
+        keepdims=False,
+        where=None,
+    ):
+        return jax_frontend.numpy.min(
+            self, axis=axis, out=out, keepdims=keepdims, where=where
+        )
+
     def var(
         self, *, axis=None, dtype=None, out=None, ddof=False, keepdims=False, where=None
     ):


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_jax/test_devicearray.py b/ivy_tests/test_ivy/test_frontends/test_jax/test_devicearray.py
--- a/ivy_tests/test_ivy/test_frontends/test_jax/test_devicearray.py
+++ b/ivy_tests/test_ivy/test_frontends/test_jax/test_devicearray.py
@@ -2162,6 +2162,7 @@ def test_jax_devicearray_var(
     on_device,
     frontend,
     ddof,
+    backend_fw,
     frontend_method_data,
     init_flags,
     method_flags,
@@ -2169,6 +2170,7 @@ def test_jax_devicearray_var(
     input_dtype, x, axis = dtype_and_x
     helpers.test_frontend_method(
         init_input_dtypes=input_dtype,
+        backend_to_test=backend_fw,
         init_all_as_kwargs_np={
             "object": x[0],
         },
@@ -2186,3 +2188,46 @@ def test_jax_devicearray_var(
         rtol_=1e-3,
         atol_=1e-3,
     )
+
+
+# min
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="jax.numpy.array",
+    method_name="min",
+    dtype_and_x=helpers.dtype_values_axis(
+        available_dtypes=helpers.get_dtypes("float"),
+        force_int_axis=True,
+        min_num_dims=1,
+        valid_axis=True,
+    ),
+    keepdims=st.booleans(),
+)
+def test_jax_devicearray_min(
+    dtype_and_x,
+    keepdims,
+    on_device,
+    frontend,
+    backend_fw,
+    frontend_method_data,
+    init_flags,
+    method_flags,
+):
+    input_dtype, x, axis = dtype_and_x
+    helpers.test_frontend_method(
+        init_input_dtypes=input_dtype,
+        backend_to_test=backend_fw,
+        init_all_as_kwargs_np={
+            "object": x[0],
+        },
+        method_input_dtypes=input_dtype,
+        method_all_as_kwargs_np={
+            "axis": axis,
+            "keepdims": keepdims,
+        },
+        frontend=frontend,
+        frontend_method_data=frontend_method_data,
+        init_flags=init_flags,
+        method_flags=method_flags,
+        on_device=on_device,
+    )
Repository: ivy-llc/ivy

Issue:
finfo



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/jax/numpy/dtype.py b/ivy/functional/frontends/jax/numpy/dtype.py
--- a/ivy/functional/frontends/jax/numpy/dtype.py
+++ b/ivy/functional/frontends/jax/numpy/dtype.py
@@ -6,6 +6,7 @@
     promote_types_jax,
 )
 from ivy.functional.frontends.numpy import dtype as np_dtype
+from ivy import with_supported_dtypes
 
 
 @to_ivy_arrays_and_back
@@ -82,3 +83,12 @@ def promote_types(type1, type2, /):
 @to_ivy_arrays_and_back
 def result_type(*args):
     return ivy.result_type(*args)
+
+
+@with_supported_dtypes(
+    {"2.13.0 and below": ("float16", "float32", "float64")},
+    "jax",
+)
+@to_ivy_arrays_and_back
+def finfo(dtype):
+    return ivy.finfo(dtype)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_dtype.py b/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_dtype.py
--- a/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_dtype.py
+++ b/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_dtype.py
@@ -102,3 +102,20 @@ def test_jax_result_type(
         test_values=False,
         **kw,
     )
+
+
+@handle_frontend_test(
+    fn_tree="jax.numpy.finfo",
+    dtype=helpers.get_dtypes("numeric", full=False),
+    test_with_out=st.just(False),
+)
+def test_jax_finfo(*, dtype, test_flags, on_device, fn_tree, frontend, backend_fw):
+    helpers.test_frontend_function(
+        input_dtypes=[],
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        dtype=dtype[0],
+        backend_to_test=backend_fw,
+    )
Repository: ivy-llc/ivy

Issue:
heaviside



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/tensor/math.py b/ivy/functional/frontends/paddle/tensor/math.py
--- a/ivy/functional/frontends/paddle/tensor/math.py
+++ b/ivy/functional/frontends/paddle/tensor/math.py
@@ -360,6 +360,14 @@ def max(x, axis=None, keepdim=False, name=None):
     return ivy.max(x, axis=axis, keepdims=keepdim)
 
 
+@with_supported_dtypes(
+    {"2.5.0 and below": ("float16", "float32", "float64", "int32", "int64")}, "paddle"
+)
+@to_ivy_arrays_and_back
+def heaviside(x, y, name=None):
+    return ivy.heaviside(x, y)
+
+
 @with_supported_dtypes({"2.5.0 and below": ("float32", "float64")}, "paddle")
 @to_ivy_arrays_and_back
 def lerp(x, y, weight, name=None):


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_math.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_math.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_math.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_math.py
@@ -1533,3 +1533,36 @@ def test_paddle_outer(
         x=x[0],
         y=x[1],
     )
+
+
+# heaviside
+@handle_frontend_test(
+    fn_tree="paddle.tensor.math.heaviside",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float"),
+        num_arrays=2,
+        allow_inf=False,
+        large_abs_safety_factor=2,
+        small_abs_safety_factor=2,
+        safety_factor_scale="log",
+        shared_dtype=True,
+    ),
+)
+def test_paddle_heaviside(
+    *,
+    dtype_and_x,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+):
+    input_dtype, x = dtype_and_x
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        frontend=frontend,
+        fn_tree=fn_tree,
+        test_flags=test_flags,
+        on_device=on_device,
+        x=x[0],
+        y=x[1],
+    )
Repository: ivy-llc/ivy

Issue:
__lshift__



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
@@ -557,3 +557,6 @@ def ptp(self, *, axis=None, out=None, keepdims=False):
 
     def __rshift__(self, value, /):
         return ivy.bitwise_right_shift(self.ivy_array, value)
+
+    def __lshift__(self, value, /):
+        return ivy.bitwise_left_shift(self.ivy_array, value)


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
@@ -3210,6 +3210,60 @@ def test_numpy_instance_rshift__(
     )
 
 
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="numpy.array",
+    method_name="__lshift__",
+    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_lshift__(
+    dtype_and_x,
+    frontend_method_data,
+    init_flags,
+    method_flags,
+    frontend,
+    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],
+        },
+        method_input_dtypes=input_dtypes,
+        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,
+    )
+
+
 # __tostring__
 @handle_frontend_method(
     class_tree=CLASS_TREE,
Repository: ivy-llc/ivy

Issue:
tril_



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
@@ -854,6 +854,10 @@ def sort(self, dim=-1, descending=False):
     def tril(self, diagonal=0):
         return torch_frontend.tril(self, diagonal=diagonal)
 
+    def tril_(self, diagonal=0):
+        self.ivy_array = self.tril(diagonal=diagonal).ivy_array
+        return self
+
     def index_select(self, dim, index):
         return torch_frontend.index_select(self, dim, index)
 


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
@@ -6132,6 +6132,44 @@ def test_torch_instance_tril(
     )
 
 
+# tril_
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="torch.tensor",
+    method_name="tril_",
+    dtype_and_values=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("numeric"),
+        min_num_dims=2,  # Torch requires this.
+    ),
+    diagonal=st.integers(min_value=-100, max_value=100),
+)
+def test_torch_instance_tril_(
+    dtype_and_values,
+    diagonal,
+    frontend_method_data,
+    init_flags,
+    method_flags,
+    frontend,
+    on_device,
+):
+    input_dtype, x = dtype_and_values
+    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={
+            "diagonal": diagonal,
+        },
+        frontend_method_data=frontend_method_data,
+        init_flags=init_flags,
+        method_flags=method_flags,
+        frontend=frontend,
+        on_device=on_device,
+    )
+
+
 # sqrt
 @handle_frontend_method(
     class_tree=CLASS_TREE,
Repository: ivy-llc/ivy

Issue:
f
numpy.random.f function


Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/numpy/random/functions.py b/ivy/functional/frontends/numpy/random/functions.py
--- a/ivy/functional/frontends/numpy/random/functions.py
+++ b/ivy/functional/frontends/numpy/random/functions.py
@@ -185,6 +185,17 @@ def gumbel(loc=0.0, scale=1.0, size=None):
     return x
 
 
+@to_ivy_arrays_and_back
+@from_zero_dim_arrays_to_scalar
+def f(dfn, dfd, size=None):
+    # Generate samples from the uniform distribution
+    x1 = ivy.gamma(ivy.to_scalar(ivy.divide(dfn, 2)), 2.0, shape=size, dtype="float64")
+    x2 = ivy.gamma(ivy.to_scalar(ivy.divide(dfd, 2)), 2.0, shape=size, dtype="float64")
+    # Calculate the F-distributed samples
+    samples = ivy.divide(ivy.divide(x1, ivy.array(dfn)), ivy.divide(x2, ivy.array(dfd)))
+    return samples
+
+
 @to_ivy_arrays_and_back
 @from_zero_dim_arrays_to_scalar
 def gamma(shape, scale=1.0, size=None):


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_numpy/test_random/test_functions.py b/ivy_tests/test_ivy/test_frontends/test_numpy/test_random/test_functions.py
--- a/ivy_tests/test_ivy/test_frontends/test_numpy/test_random/test_functions.py
+++ b/ivy_tests/test_ivy/test_frontends/test_numpy/test_random/test_functions.py
@@ -749,6 +749,53 @@ def test_numpy_gumbel(
     )
 
 
+@handle_frontend_test(
+    fn_tree="numpy.random.f",
+    input_dtypes=helpers.get_dtypes("float"),
+    dfn=st.floats(
+        allow_nan=False,
+        allow_infinity=False,
+        width=32,
+        min_value=1,
+        max_value=1000,
+        exclude_min=True,
+    ),
+    dfd=st.floats(
+        allow_nan=False,
+        allow_infinity=False,
+        width=32,
+        min_value=1,
+        max_value=1000,
+        exclude_min=True,
+    ),
+    size=helpers.get_shape(allow_none=False),
+)
+def test_numpy_f(
+    input_dtypes,
+    size,
+    frontend,
+    test_flags,
+    backend_fw,
+    fn_tree,
+    on_device,
+    dfn,
+    dfd,
+):
+    test_flags.num_positional_args = 2
+    helpers.test_frontend_function(
+        input_dtypes=input_dtypes,
+        backend_to_test=backend_fw,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        test_values=False,
+        on_device=on_device,
+        dfn=dfn,
+        dfd=dfd,
+        size=size,
+    )
+
+
 @handle_frontend_test(
     fn_tree="numpy.random.gamma",
     input_dtypes=helpers.get_dtypes("float", full=False),
Repository: ivy-llc/ivy

Issue:
igamma



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
@@ -1,6 +1,10 @@
 # global
 import ivy
-from ivy import with_supported_dtypes, with_unsupported_dtypes
+from ivy import (
+    with_supported_dtypes,
+    with_unsupported_dtypes,
+    with_supported_device_and_dtypes,
+)
 from ivy.functional.frontends.tensorflow import check_tensorflow_casting
 from ivy.functional.frontends.tensorflow.func_wrapper import (
     to_ivy_arrays_and_back,
@@ -729,3 +733,17 @@ def bincount(
     binary_output=False,
 ):
     return ivy.bincount(arr, weights=weights, minlength=minlength)
+
+
+@with_supported_device_and_dtypes(
+    {
+        "2.13.0 and below": {
+            "cpu": ("float32", "float64"),
+            "gpu": ("bfloat16", "float16", "float32", "float64"),
+        }
+    },
+    "tensorflow",
+)
+@to_ivy_arrays_and_back
+def igamma(a, x, name=None):
+    return ivy.igamma(a, x=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
@@ -2888,3 +2888,43 @@ def test_tensorflow_bincount(
         weights=None,
         minlength=0,
     )
+
+
+@handle_frontend_test(
+    fn_tree="tensorflow.math.igamma",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("valid"),
+        num_arrays=2,
+        shared_dtype=True,
+        abs_smallest_val=1e-5,
+        min_num_dims=2,
+        max_num_dims=2,
+        min_dim_size=3,
+        max_dim_size=3,
+        min_value=2,
+        max_value=100,
+        allow_nan=False,
+    ),
+    test_with_out=st.just(False),
+)
+def test_tensorflow_igamma(
+    *,
+    dtype_and_x,
+    on_device,
+    fn_tree,
+    backend_fw,
+    frontend,
+    test_flags,
+):
+    input_dtype, xs = 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,
+        rtol=1e-04,
+        a=xs[0],
+        x=xs[1],
+    )
Repository: ivy-llc/ivy

Issue:
Fix paddle_math.test_paddle_conj
|   |   |
|---|---|
|numpy|<a href="https://github.com/unifyai/ivy/actions/runs/6197499538/job/16826154279"><img src=https://img.shields.io/badge/-failure-red></a>
|jax|<a href="https://github.com/unifyai/ivy/actions/runs/6197499538/job/16826154279"><img src=https://img.shields.io/badge/-failure-red></a>
|tensorflow|<a href="https://github.com/unifyai/ivy/actions/runs/6197499538/job/16826154279"><img src=https://img.shields.io/badge/-failure-red></a>
|torch|<a href="https://github.com/unifyai/ivy/actions/runs/6197499538/job/16826154279"><img src=https://img.shields.io/badge/-failure-red></a>
|paddle|<a href="https://github.com/unifyai/ivy/actions/runs/6197499538/job/16826154279"><img src=https://img.shields.io/badge/-success-success></a>



Discussion:

Resolving patch:
diff --git a/ivy/functional/backends/numpy/experimental/elementwise.py b/ivy/functional/backends/numpy/experimental/elementwise.py
--- a/ivy/functional/backends/numpy/experimental/elementwise.py
+++ b/ivy/functional/backends/numpy/experimental/elementwise.py
@@ -268,7 +268,7 @@ def conj(
     out: Optional[np.ndarray] = None,
 ) -> np.ndarray:
     ret = np.conj(x, out=out)
-    if x.dtype == np.bool:
+    if x.dtype == bool:
         return ret.astype("bool")
     return ret
 


Test patch:
Repository: ivy-llc/ivy

Issue:
 view_as_real



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/torch/miscellaneous_ops.py b/ivy/functional/frontends/torch/miscellaneous_ops.py
--- a/ivy/functional/frontends/torch/miscellaneous_ops.py
+++ b/ivy/functional/frontends/torch/miscellaneous_ops.py
@@ -410,3 +410,18 @@ def clone(input):
 @to_ivy_arrays_and_back
 def cov(input, /, *, correction=1, fweights=None, aweights=None):
     return ivy.cov(input, ddof=correction, fweights=fweights, aweights=aweights)
+
+
+@with_supported_dtypes(
+    {"2.0.1 and below": ("complex64", "complex128")},
+    "torch",
+)
+@to_ivy_arrays_and_back
+def view_as_real(input):
+    if not ivy.is_complex_dtype(input):
+        raise ivy.exceptions.IvyError(
+            "view_as_real is only supported for complex tensors"
+        )
+    re_part = ivy.real(input)
+    im_part = ivy.imag(input)
+    return ivy.stack((re_part, im_part), axis=-1)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_torch/test_miscellaneous_ops.py b/ivy_tests/test_ivy/test_frontends/test_torch/test_miscellaneous_ops.py
--- a/ivy_tests/test_ivy/test_frontends/test_torch/test_miscellaneous_ops.py
+++ b/ivy_tests/test_ivy/test_frontends/test_torch/test_miscellaneous_ops.py
@@ -1485,3 +1485,30 @@ def test_torch_cov(
         fweights=fweights,
         aweights=aweights,
     )
+
+
+# view_as_real
+@handle_frontend_test(
+    fn_tree="torch.view_as_real",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("valid"),
+        num_arrays=1,
+    ),
+)
+def test_torch_view_as_real(
+    *,
+    dtype_and_x,
+    on_device,
+    fn_tree,
+    frontend,
+    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,
+        input=np.asarray(x[0], dtype=input_dtype[0]),
+    )
Repository: ivy-llc/ivy

Issue:
any



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/tensor/math.py b/ivy/functional/frontends/paddle/tensor/math.py
--- a/ivy/functional/frontends/paddle/tensor/math.py
+++ b/ivy/functional/frontends/paddle/tensor/math.py
@@ -392,3 +392,9 @@ def rsqrt(x, name=None):
 @to_ivy_arrays_and_back
 def prod(x, axis=None, keepdim=False, dtype=None, name=None):
     return ivy.prod(x, axis=axis, keepdims=keepdim, dtype=dtype)
+
+
+@with_supported_dtypes({"2.5.0 and below": "bool"}, "paddle")
+@to_ivy_arrays_and_back
+def any(x, axis=None, keepdim=False, name=None):
+    return ivy.any(x, axis=axis, keepdims=keepdim)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_math.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_math.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_math.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_math.py
@@ -1745,3 +1745,37 @@ def test_paddle_prod(
         keepdim=False,
         backend_to_test="paddle",
     )
+
+
+# any
+@handle_frontend_test(
+    fn_tree="paddle.tensor.math.any",
+    dtype_and_x=helpers.dtype_values_axis(
+        available_dtypes=["bool"],
+        valid_axis=True,
+        allow_neg_axes=True,
+        force_int_axis=True,
+        min_num_dims=1,
+    ),
+)
+def test_paddle_any(
+    *,
+    dtype_and_x,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+    backend_fw,
+):
+    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,
+        backend_to_test=backend_fw,
+        x=x[0],
+        axis=axis,
+        keepdim=False,
+    )
Repository: ivy-llc/ivy

Issue:
 tensor_diag



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/tensorflow/linalg.py b/ivy/functional/frontends/tensorflow/linalg.py
--- a/ivy/functional/frontends/tensorflow/linalg.py
+++ b/ivy/functional/frontends/tensorflow/linalg.py
@@ -329,3 +329,27 @@ def qr(input, /, *, full_matrices=False, name=None):
 )
 def inv(input, adjoint=False, name=None):
     return ivy.inv(input, adjoint=adjoint)
+
+
+@to_ivy_arrays_and_back
+@with_supported_dtypes(
+    {
+        "2.13.0 and below": (
+            "bfloat16",
+            "half",
+            "float32",
+            "float64",
+            "int32",
+            "int64",
+            "complex64",
+            "complex128",
+        )
+    },
+    "tensorflow",
+)
+def tensor_diag(diagonal, /, *, name=None):
+    diagonal = ivy.array(diagonal)
+    rank = ivy.matrix_rank(diagonal)
+    if rank > 1:
+        raise ValueError("wrong tensor rank, at most 1")
+    return ivy.diag(diagonal)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_linalg.py b/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_linalg.py
--- a/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_linalg.py
+++ b/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_linalg.py
@@ -999,3 +999,36 @@ def test_qr(
         atol=1e-2,
         ground_truth_backend=frontend,
     )
+
+
+# tensor_diag
+@handle_frontend_test(
+    fn_tree="tensorflow.linalg.tensor_diag",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("valid"),
+        min_num_dims=1,
+        max_num_dims=1,
+        min_dim_size=5,
+        max_dim_size=10,
+        min_value=1,
+        max_value=10,
+    ),
+    test_with_out=st.just(False),
+)
+def test_tensorflow_tensor_diag(
+    *,
+    dtype_and_x,
+    frontend,
+    test_flags,
+    fn_tree,
+    on_device,
+):
+    dtype, x = dtype_and_x
+    helpers.test_frontend_function(
+        input_dtypes=dtype,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        diagonal=x[0],
+    )