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

Issue:
count_nonzero



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
@@ -909,7 +909,10 @@ 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)
+        return torch_frontend.cumprod(self._ivy_array, dim, dtype=dtype) 
+    
+    def count_nonzero(self, dim):
+        return torch_frontend.count_nonzero(self._ivy_array, dim=dim)
 
     @with_unsupported_dtypes({"1.11.0 and below": ("bfloat16",)}, "torch")
     def exp(self, *, out=None):


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
@@ -6215,6 +6215,47 @@ def test_torch_instance_fmin(
     )
 
 
+
+# count_nonzero
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="torch.tensor",
+    method_name="count_nonzero",
+    dtype_value=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("valid"),
+        shape=st.shared(helpers.get_shape(min_num_dims=1), key="shape"),
+    ),
+    dim=helpers.get_axis(
+        shape=st.shared(helpers.get_shape(), key="shape"),
+        allow_neg=True,
+        force_int=True,
+    ),
+)
+def test_torch_instance_count_nonzero(
+    dtype_value,
+    dim,
+    frontend_method_data,
+    init_flags,
+    method_flags,
+    frontend,
+    on_device,
+):
+    input_dtype, x = dtype_value
+    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={"dim": dim},
+        frontend_method_data=frontend_method_data,
+        init_flags=init_flags,
+        method_flags=method_flags,
+        frontend=frontend,
+        on_device=on_device,
+    )    
+
+
 # exp
 @handle_frontend_method(
     class_tree=CLASS_TREE,
Repository: ivy-llc/ivy

Issue:
logit



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/torch/pointwise_ops.py b/ivy/functional/frontends/torch/pointwise_ops.py
--- a/ivy/functional/frontends/torch/pointwise_ops.py
+++ b/ivy/functional/frontends/torch/pointwise_ops.py
@@ -492,3 +492,16 @@ def fmod(x1, x2, out=None):
 @to_ivy_arrays_and_back
 def imag(input):
     return ivy.imag(input)
+
+
+@with_unsupported_dtypes({"1.11.0 and below": ("float16", "bfloat16")}, "torch")
+@to_ivy_arrays_and_back
+def logit(input, eps=None, *, out=None):
+    if eps is None:
+        eps = -1.0
+    lo = eps
+    hi = 1 - eps
+
+    input = ivy.clip(input, lo, hi, out=out)
+
+    return ivy.log(ivy.divide(input, ivy.subtract(1, input), out=out), out=out)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_torch/test_pointwise_ops.py b/ivy_tests/test_ivy/test_frontends/test_torch/test_pointwise_ops.py
--- a/ivy_tests/test_ivy/test_frontends/test_torch/test_pointwise_ops.py
+++ b/ivy_tests/test_ivy/test_frontends/test_torch/test_pointwise_ops.py
@@ -2304,3 +2304,38 @@ def test_torch_imag(
         on_device=on_device,
         input=input[0],
     )
+
+
+@handle_frontend_test(
+    fn_tree="torch.logit",
+    dtype_and_input=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float"),
+        min_num_dims=1,
+        max_num_dims=1,
+        min_dim_size=1,
+        max_dim_size=1,
+        min_value=-10,
+        max_value=10,
+    ),
+    eps=st.sampled_from([1e-05, -1e-05, None]),
+)
+def test_torch_logit(
+    *,
+    dtype_and_input,
+    eps,
+    frontend,
+    test_flags,
+    fn_tree,
+    on_device,
+):
+    input_dtype, input = dtype_and_input
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        input=input[0],
+        eps=eps,
+        out=None
+    )
Repository: ivy-llc/ivy

Issue:
asarray_chkfinite



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/numpy/manipulation_routines/changing_array_shape.py b/ivy/functional/frontends/numpy/manipulation_routines/changing_array_shape.py
--- a/ivy/functional/frontends/numpy/manipulation_routines/changing_array_shape.py
+++ b/ivy/functional/frontends/numpy/manipulation_routines/changing_array_shape.py
@@ -28,3 +28,13 @@ def ravel(a, order="C"):
 @to_ivy_arrays_and_back
 def moveaxis(a, source, destination):
     return ivy.moveaxis(a, source, destination)
+
+
+@to_ivy_arrays_and_back
+def asarray_chkfinite(a, dtype=None, order=None):
+    a = ivy.asarray(a, dtype=dtype)
+    if not ivy.all(ivy.isfinite(a)):
+        raise ValueError(
+            "array must not contain infs or NaNs"
+        )
+    return a


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_numpy/test_manipulation_routines/test_changing_array_shape.py b/ivy_tests/test_ivy/test_frontends/test_numpy/test_manipulation_routines/test_changing_array_shape.py
--- a/ivy_tests/test_ivy/test_frontends/test_numpy/test_manipulation_routines/test_changing_array_shape.py
+++ b/ivy_tests/test_ivy/test_frontends/test_numpy/test_manipulation_routines/test_changing_array_shape.py
@@ -180,3 +180,30 @@ def test_numpy_moveaxis(
         source=source,
         destination=destination,
     )
+
+
+# asarray_chkfinite
+@handle_frontend_test(
+    fn_tree="numpy.asarray_chkfinite",
+    dtype_and_a=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float")
+    ),
+    test_with_out=st.just(False),
+)
+def test_numpy_asarray_chkfinite(
+    *,
+    dtype_and_a,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+):
+    dtype, a = dtype_and_a
+    helpers.test_frontend_function(
+        input_dtypes=dtype,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        a=a[0],
+    )
Repository: ivy-llc/ivy

Issue:
atan2
Implementing atan2 functionality for TensorFlow frontend.

Solves https://github.com/unifyai/ivy/issues/1545


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
@@ -512,6 +512,11 @@ def atan(x, name=None):
     return ivy.atan(x)
 
 
+@to_ivy_arrays_and_back
+def atan2(y, x, name=None):
+    return ivy.atan2(y, x)
+
+
 @to_ivy_arrays_and_back
 def log(x, name=None):
     return ivy.log(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
@@ -2082,6 +2082,35 @@ def test_tensorflow_cosh(
     )
 
 
+# atan2
+@handle_frontend_test(
+    fn_tree="tensorflow.math.atan2",
+    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_atan2(
+    *,
+    dtype_and_x,
+    frontend,
+    test_flags,
+    fn_tree,
+    on_device,
+):
+    input_dtype, x = dtype_and_x
+    assume(not np.any(np.isclose(x[1], 0)))
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        y=x[0],
+        x=x[1],
+    )
+
+
 # less_equal
 @handle_frontend_test(
     fn_tree="tensorflow.math.less_equal",
Repository: ivy-llc/ivy

Issue:
Fix math.test_tensorflow_is_finite
|   |   |
|---|---|
|jax|<a href="https://github.com/unifyai/ivy/actions/runs/5629743168/job/15255044367"><img src=https://img.shields.io/badge/-failure-red></a>
|numpy|<a href="https://github.com/unifyai/ivy/actions/runs/5629743168/job/15255044367"><img src=https://img.shields.io/badge/-failure-red></a>
|tensorflow|<a href="https://github.com/unifyai/ivy/actions/runs/5629743168/job/15255044367"><img src=https://img.shields.io/badge/-failure-red></a>
|torch|<a href="https://github.com/unifyai/ivy/actions/runs/5629743168/job/15255044367"><img src=https://img.shields.io/badge/-failure-red></a>
|paddle|<a href="https://github.com/unifyai/ivy/actions/runs/5629743168/job/15255044367"><img src=https://img.shields.io/badge/-failure-red></a>



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
@@ -502,6 +502,7 @@ def is_nan(x, name=None):
     },
     "tensorflow",
 )
+@to_ivy_arrays_and_back
 def is_finite(x, name=None):
     return ivy.isfinite(x)
 


Test patch:
Repository: ivy-llc/ivy

Issue:
logical_not



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
@@ -291,6 +291,9 @@ def abs_(self):
     def logical_and(self, other):
         return torch_frontend.logical_and(self._ivy_array, other)
 
+    def logical_not(self, *, out=None):
+        return torch_frontend.logical_not(self._ivy_array, out=out)
+
     def logical_or(self, other):
         return torch_frontend.logical_or(self._ivy_array, other)
 


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
@@ -3143,6 +3143,39 @@ def test_torch_instance_logical_and(
     )
 
 
+# logical_not
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="torch.tensor",
+    method_name="logical_not",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("valid"), num_arrays=1
+    ),
+)
+def test_torch_instance_logical_not(
+    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,
+    )
+
+
 # logical_or
 @handle_frontend_method(
     class_tree=CLASS_TREE,
Repository: ivy-llc/ivy

Issue:
tostring



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
@@ -321,6 +321,9 @@ def std(
     def tobytes(self, order="C") -> bytes:
         return np_frontend.tobytes(self, order=order)
 
+    def tostring(self, order="C") -> bytes:
+        return np_frontend.tobytes(self.data, order=order)
+
     def prod(
         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
@@ -2831,8 +2831,8 @@ def test_numpy_instance_tobytes__(
         frontend_method_data=frontend_method_data,
         on_device=on_device,
     )
-
-
+    
+    
 # tofile
 @handle_frontend_method(
     class_tree=CLASS_TREE,
@@ -2907,7 +2907,7 @@ def test_numpy_instance_tolist__(
         test_values=False,  # Todo change this after we add __iter__ to ndarray
     )
 
-
+    
 # __getitem__
 @handle_frontend_method(
     class_tree=CLASS_TREE,
@@ -3113,3 +3113,36 @@ def test_numpy_instance_rshift__(
         method_flags=method_flags,
         on_device=on_device,
     )
+
+   
+ # __tostring__
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="numpy.array",
+    method_name="tostring",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("valid"),
+    ),
+)
+def test_numpy_instance_tostring__(
+    dtype_and_x,
+    frontend_method_data,
+    init_flags,
+    method_flags,
+    frontend,
+    on_device,
+):
+    input_dtypes, x = dtype_and_x
+    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={},
+        init_flags=init_flags,
+        method_flags=method_flags,
+        frontend=frontend,
+        frontend_method_data=frontend_method_data,
+        on_device=on_device,
+    )
\ No newline at end of file
Repository: ivy-llc/ivy

Issue:
bernoulli



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
working on it...

Resolving patch:
diff --git a/ivy/functional/frontends/torch/random_sampling.py b/ivy/functional/frontends/torch/random_sampling.py
--- a/ivy/functional/frontends/torch/random_sampling.py
+++ b/ivy/functional/frontends/torch/random_sampling.py
@@ -115,3 +115,22 @@ def randn(
         dtype=dtype,
         device=device,
     )
+
+
+@with_supported_dtypes(
+    {
+        "1.11.0 and below": (
+            "float32",
+            "float64",
+        )
+    },
+    "torch",
+)
+@to_ivy_arrays_and_back
+def bernoulli(
+    input, 
+    *,
+    generator=None,
+    out=None
+):
+    return ivy.bernoulli(input, out=out)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_torch/test_random_sampling.py b/ivy_tests/test_ivy/test_frontends/test_torch/test_random_sampling.py
--- a/ivy_tests/test_ivy/test_frontends/test_torch/test_random_sampling.py
+++ b/ivy_tests/test_ivy/test_frontends/test_torch/test_random_sampling.py
@@ -234,3 +234,45 @@ def call():
     for (u, v) in zip(ret_np, ret_from_np):
         assert u.dtype == v.dtype
         assert u.shape == v.shape
+
+
+@handle_frontend_test(
+    fn_tree="torch.bernoulli",
+    dtype_and_probs=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float", full=False),
+        min_value=0,
+        max_value=1,
+        min_num_dims=0,
+    ),
+)
+def test_torch_bernoulli(
+    dtype_and_probs,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+):
+    dtype, probs = dtype_and_probs
+
+    def call():
+        return helpers.test_frontend_function(
+            input_dtypes=dtype,
+            frontend=frontend,
+            test_flags=test_flags,
+            fn_tree=fn_tree,
+            on_device=on_device,
+            test_values=False,
+            input=probs[0],
+        )
+
+    ret = call()
+
+    if not ivy.exists(ret):
+        return
+
+    ret_np, ret_from_np = ret
+    ret_np = helpers.flatten_and_to_np(ret=ret_np)
+    ret_from_np = helpers.flatten_and_to_np(ret=ret_from_np)
+    for (u, v) in zip(ret_np, ret_from_np):
+        assert u.dtype == v.dtype
+        assert u.shape == v.shape
Repository: ivy-llc/ivy

Issue:
greater_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
@@ -636,3 +636,9 @@ def cosh(x, name=None):
 )
 def zeta(x, q, name=None):
     return ivy.zeta(x, q)
+
+
+@to_ivy_arrays_and_back
+def greater_equal(x, y, name=None):
+    x, y = check_tensorflow_casting(x, y)
+    return ivy.greater_equal(x, y)


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
@@ -2388,3 +2388,33 @@ def test_tensorflow_zeta(
         x=x[0],
         q=x[1],
     )
+
+
+# greater_equal
+@handle_frontend_test(
+    fn_tree="tensorflow.math.greater_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_greater_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],
+    )
Repository: ivy-llc/ivy

Issue:
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
@@ -253,3 +253,43 @@ def einsum(equation, *inputs, **kwargs):
 @to_ivy_arrays_and_back
 def adjoint(matrix, name=None):
     return ivy.adjoint(matrix)
+
+
+@to_ivy_arrays_and_back
+def diag(
+    diagonal,
+    /,
+    k=0,
+    *,
+    num_rows=None,
+    num_cols=None,
+    padding_value=0,
+    align="RIGHT_LEFT",
+    name="diag",
+):
+    # TODO: Implement ivy.matrix_diag in ivy API
+    diagonal = ivy.array(diagonal)
+    shape = list(diagonal.shape)
+    shape[-1] += abs(k)
+
+    output = ivy.full(shape + [shape[-1]], padding_value)
+    if k > 0:
+        for i in range(shape[-1]):
+            try:
+                output[..., i, i + k] = diagonal[..., i]
+            except IndexError:
+                break
+
+    else:
+        for i in range(shape[-1]):
+            try:
+                output[..., i + abs(k), i] = diagonal[..., i]
+            except IndexError:
+                break
+
+    size = 1
+    for dim in output.shape:
+        size *= dim
+    if (num_cols and num_rows) and (size == (num_cols * num_rows)):
+        output = ivy.reshape(output, (num_rows, num_cols))
+    return ivy.astype(output, ivy.dtype(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
@@ -835,3 +835,37 @@ def test_tensorflow_adjoint(
         on_device=on_device,
         matrix=x[0],
     )
+
+
+# diag
+@handle_frontend_test(
+    fn_tree="tensorflow.linalg.diag",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=["int64", "int32"],
+        min_num_dims=1,
+        max_num_dims=2,
+        min_dim_size=5,
+        max_dim_size=10,
+        min_value=0,
+        max_value=10,
+    ),
+    k=st.just(0),
+)
+def test_tensorflow_diag(
+    dtype_and_x,
+    k,
+    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,
+        v=x[0],
+        k=k,
+    )
Repository: ivy-llc/ivy

Issue:
ensure_shape



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/tensorflow/general_functions.py b/ivy/functional/frontends/tensorflow/general_functions.py
--- a/ivy/functional/frontends/tensorflow/general_functions.py
+++ b/ivy/functional/frontends/tensorflow/general_functions.py
@@ -174,6 +174,14 @@ def shape_n(input, out_type=ivy.int32, name=None):
         return [ivy.array(ivy.shape(i), dtype="int64") for i in input]
 
 
+@to_ivy_arrays_and_back
+def ensure_shape(x, shape, name=None):
+    x = EagerTensor(x)
+    x.set_shape(shape)
+
+    return x
+
+
 @with_unsupported_dtypes({"2.10.0 and below": ("float16", "bfloat16")}, "tensorflow")
 @handle_tf_dtype
 @to_ivy_arrays_and_back


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_general_functions.py b/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_general_functions.py
--- a/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_general_functions.py
+++ b/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_general_functions.py
@@ -8,6 +8,7 @@
 from ivy_tests.test_ivy.test_frontends.test_numpy.test_creation_routines.test_from_shape_or_value import (  # noqa : E501
     _input_fill_and_dtype,
 )
+from ivy_tests.test_ivy.test_frontends.test_tensorflow.test_tensor import _array_and_shape # noqa : E501
 from ivy_tests.test_ivy.helpers import handle_frontend_test
 from ivy_tests.test_ivy.test_functional.test_core.test_linalg import _matrix_rank_helper
 from tensorflow import errors as tf_errors
@@ -776,6 +777,31 @@ def test_tensorflow_shape_n(
     )
 
 
+@handle_frontend_test(
+    fn_tree="tensorflow.ensure_shape",
+    dtype_and_x=_array_and_shape(
+        min_num_dims=0,
+        max_num_dims=5
+    )
+)
+def test_tensorflow_ensure_shape(
+    *,
+    dtype_and_x,
+    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,
+        x=x[0],
+        shape=x[1]
+    )
+
+
 # range
 @handle_frontend_test(
     fn_tree="tensorflow.range",
Repository: ivy-llc/ivy

Issue:
is_inf



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
@@ -156,6 +156,11 @@ def erfcinv(x, name="erfcinv"):
     return 1 / (1 - ivy.erf(x))
 
 
+@to_ivy_arrays_and_back
+def is_inf(x, name=None):
+    return ivy.isinf(x)
+
+
 @to_ivy_arrays_and_back
 def is_non_decreasing(x, name="is_non_decreasing"):
     if ivy.array(x).size < 2:


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
@@ -969,6 +969,31 @@ def test_tensorflow_erfcinv(
     )
 
 
+# is_inf
+@handle_frontend_test(
+    fn_tree="tensorflow.math.is_inf",
+    dtype_and_x=helpers.dtype_and_values(available_dtypes=helpers.get_dtypes("float")),
+    test_with_out=st.just(False),
+)
+def test_tensorflow_is_inf(
+    *,
+    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],
+    )
+    
+
 # is_non_decreasing
 @handle_frontend_test(
     fn_tree="tensorflow.math.is_non_decreasing",