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

Issue:
TanhGrad



Discussion:

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
@@ -486,6 +486,11 @@ def Sum(*, input, axis, keep_dims=False, name="Sum"):
 Tanh = to_ivy_arrays_and_back(map_raw_ops_alias(tf_frontend.math.tanh))
 
 
+@to_ivy_arrays_and_back
+def TanhGrad(*, y, dy, name='TanhGrad'):
+    return ivy.multiply(dy,ivy.subtract(1,ivy.multiply(y,y)))
+
+
 @to_ivy_arrays_and_back
 def Transpose(*, x, perm, name="Transpose"):
     ret = ivy.permute_dims(x, axes=perm)


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
@@ -1024,6 +1024,36 @@ def test_tensorflow_Tanh(  # NOQA
     )
 
 
+#TanhGrad
+@handle_frontend_test(
+    fn_tree='tensorflow.raw_ops.TanhGrad',
+    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_TanhGrad( #NOQA
+    *,
+    dtype_and_x,
+    frontend,
+    test_flags,
+    fn_tree,
+    on_device,
+):
+    dtype, xs = dtype_and_x
+    helpers.test_frontend_function(
+        input_dtypes=dtype,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        y=xs[0],
+        dy=xs[1],
+    )
+
+
 @st.composite
 def _permute_dims_helper(draw):
     shape = draw(st.shared(helpers.get_shape(min_num_dims=1), key="shape"))
Repository: ivy-llc/ivy

Issue:
norm



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
@@ -448,3 +448,16 @@ def unstack(value: ivy.Array, axis=0, num=None, name=None):
 @to_ivy_arrays_and_back
 def reverse(tensor, axis, name=None):
     return ivy.flip(tensor, axis=axis)
+
+
+@to_ivy_arrays_and_back
+def norm(tensor, ord="euclidean", axis=None, keepdims=None, name=None):
+    return tf_frontend.linalg.norm(
+        tensor, ord=ord, axis=axis, keepdims=keepdims, name=name
+    )
+
+
+norm.supported_dtypes = (
+    "float32",
+    "float64",
+)


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
@@ -1750,3 +1750,42 @@ def test_tensorflow_reverse(
         tensor=x[0],
         axis=axis[0],
     )
+
+
+@handle_frontend_test(
+    fn_tree="tensorflow.norm",
+    aliases=["tensorflow.norm"],
+    dtype_values_axis=helpers.dtype_values_axis(
+        available_dtypes=helpers.get_dtypes("valid"),
+        min_num_dims=3,
+        max_num_dims=5,
+        min_dim_size=1,
+        max_dim_size=4,
+        min_axis=-3,
+        max_axis=2,
+    ),
+    ord=st.sampled_from([1, 2, np.inf]),
+    keepdims=st.booleans(),
+)
+def test_tensorflow_norm(
+    *,
+    dtype_values_axis,
+    ord,
+    keepdims,
+    frontend,
+    test_flags,
+    fn_tree,
+    on_device,
+):
+    input_dtype, x, axis = dtype_values_axis
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        tensor=x[0],
+        ord=ord,
+        axis=axis,
+        keepdims=keepdims,
+    )
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
@@ -455,6 +455,7 @@ def test_tensorflow_tensordot(
 # norm
 @handle_frontend_test(
     fn_tree="tensorflow.linalg.norm",
+    aliases=["tensorflow.norm"],
     dtype_values_axis=helpers.dtype_values_axis(
         available_dtypes=helpers.get_dtypes("valid"),
         min_num_dims=3,
Repository: ivy-llc/ivy

Issue:
diagflat



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/numpy/creation_routines/building_matrices.py b/ivy/functional/frontends/numpy/creation_routines/building_matrices.py
--- a/ivy/functional/frontends/numpy/creation_routines/building_matrices.py
+++ b/ivy/functional/frontends/numpy/creation_routines/building_matrices.py
@@ -36,3 +36,12 @@ def vander(x, N=None, increasing=False):
     elif ivy.is_bool_dtype or ivy.is_int_dtype(x):
         x = x.astype(ivy.int64)
     return ivy.vander(x, N=N, increasing=increasing)
+
+
+# diagflat
+@to_ivy_arrays_and_back
+def diagflat(v, k=0):
+    ret = ivy.diagflat(v, offset=k)
+    while len(ivy.shape(ret)) < 2:
+        ret = ret.expand_dims(axis=0)
+    return ret


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_numpy/test_creation_routines/test_building_matrices.py b/ivy_tests/test_ivy/test_frontends/test_numpy/test_creation_routines/test_building_matrices.py
--- a/ivy_tests/test_ivy/test_frontends/test_numpy/test_creation_routines/test_building_matrices.py
+++ b/ivy_tests/test_ivy/test_frontends/test_numpy/test_creation_routines/test_building_matrices.py
@@ -7,7 +7,6 @@
 from ivy_tests.test_ivy.helpers import handle_frontend_test
 from ivy_tests.test_ivy.test_functional.test_core.test_linalg import _diag_helper
 
-
 # tril
 @handle_frontend_test(
     fn_tree="numpy.tril",
@@ -161,3 +160,27 @@ def test_numpy_vander(
         N=N,
         increasing=increasing,
     )
+
+
+# diagflat
+@handle_frontend_test(
+    fn_tree="numpy.diagflat",
+    dtype_and_x_k=_diag_helper(),
+)
+def test_numpy_diagflat(
+    dtype_and_x_k,
+    frontend,
+    test_flags,
+    fn_tree,
+    on_device,
+):
+    dtype, x, k = dtype_and_x_k
+    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:
broadcast_arraus



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/numpy/manipulation_routines/changing_number_of_dimensions.py b/ivy/functional/frontends/numpy/manipulation_routines/changing_number_of_dimensions.py
--- a/ivy/functional/frontends/numpy/manipulation_routines/changing_number_of_dimensions.py
+++ b/ivy/functional/frontends/numpy/manipulation_routines/changing_number_of_dimensions.py
@@ -35,3 +35,9 @@ def atleast_2d(*arys):
 
 def atleast_3d(*arys):
     return ivy.atleast_3d(*arys)
+
+
+# broadcast_arrays
+@to_ivy_arrays_and_back
+def broadcast_arrays(*args):
+    return ivy.broadcast_arrays(*args)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_numpy/test_manipulation_routines/test_changing_number_of_dimensions.py b/ivy_tests/test_ivy/test_frontends/test_numpy/test_manipulation_routines/test_changing_number_of_dimensions.py
--- a/ivy_tests/test_ivy/test_frontends/test_numpy/test_manipulation_routines/test_changing_number_of_dimensions.py
+++ b/ivy_tests/test_ivy/test_frontends/test_numpy/test_manipulation_routines/test_changing_number_of_dimensions.py
@@ -4,6 +4,7 @@
 import ivy_tests.test_ivy.helpers as helpers
 from hypothesis import strategies as st
 from ivy_tests.test_ivy.helpers import handle_frontend_test
+from ivy_tests.test_ivy.test_functional.test_core.test_dtype import dtypes_shared
 
 
 # squeeze
@@ -176,3 +177,45 @@ def test_numpy_atleast_1d(
         on_device=on_device,
         **arys,
     )
+
+
+# broadcast_arrays
+@st.composite
+def broadcastable_arrays(draw, dtypes):
+    num_arrays = st.shared(helpers.ints(min_value=2, max_value=5), key="num_arrays")
+    shapes = draw(num_arrays.flatmap(helpers.mutually_broadcastable_shapes))
+    dtypes = draw(dtypes)
+    arrays = []
+    for c, (shape, dtype) in enumerate(zip(shapes, dtypes), 1):
+        x = draw(helpers.array_values(dtype=dtype, shape=shape), label=f"x{c}").tolist()
+        arrays.append(x)
+    return arrays
+
+
+@handle_frontend_test(
+    fn_tree="numpy.broadcast_arrays",
+    arrays=broadcastable_arrays(dtypes_shared("num_arrays")),
+    input_dtypes=dtypes_shared("num_arrays"),
+    test_with_out=st.just(False),
+)
+def test_numpy_broadcast_arrays(
+    *,
+    arrays,
+    input_dtypes,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+):
+    args = {}
+    for i, (array, dtype) in enumerate(zip(arrays, input_dtypes)):
+        args["x{}".format(i)] = np.asarray(array, dtype=dtype)
+    test_flags.num_positional_args = len(args)
+    helpers.test_frontend_function(
+        input_dtypes=input_dtypes,
+        test_flags=test_flags,
+        frontend=frontend,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        **args,
+    )
Repository: ivy-llc/ivy

Issue:
round



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
@@ -425,6 +425,11 @@ def ceil(x, name=None):
     return ivy.ceil(x)
 
 
+@to_ivy_arrays_and_back
+def round(x, name=None):
+    return ivy.round(x)   
+
+
 @to_ivy_arrays_and_back
 def minimum(x, y, name=None):
     return ivy.minimum(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
@@ -1430,6 +1430,31 @@ def test_tensorflow_ceil(
     )
 
 
+# round
+@handle_frontend_test(
+    fn_tree="tensorflow.math.round",
+    dtype_and_x=helpers.dtype_and_values(available_dtypes=helpers.get_dtypes("float")),
+    test_with_out=st.just(False),
+)
+def test_tensorflow_round(
+    *,
+    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],
+    )
+
+
 # minimum
 @handle_frontend_test(
     fn_tree="tensorflow.math.minimum",
Repository: ivy-llc/ivy

Issue:
lp_pool2d



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/torch/nn/functional/pooling_functions.py b/ivy/functional/frontends/torch/nn/functional/pooling_functions.py
--- a/ivy/functional/frontends/torch/nn/functional/pooling_functions.py
+++ b/ivy/functional/frontends/torch/nn/functional/pooling_functions.py
@@ -191,3 +191,29 @@ def lp_pool1d(input, norm_type, kernel_size, stride=None, ceil_mode=False):
         )
 
     return ivy.pow(ivy.multiply(out, kernel_size), ivy.divide(1.0, norm_type))
+
+
+@to_ivy_arrays_and_back
+def lp_pool2d(input, norm_type, kernel_size, stride=None, ceil_mode=False):
+
+    data_format = "NCHW"
+    padding = "VALID"
+    if stride is not None:
+        out = ivy.avg_pool2d(
+            ivy.pow(input, norm_type),
+            kernel_size,
+            stride,
+            padding,
+            data_format=data_format,
+        )
+    else:
+        out = ivy.avg_pool2d(
+            ivy.pow(input, norm_type),
+            kernel_size,
+            kernel_size,
+            padding,
+            data_format=data_format,
+        )
+    if not isinstance(kernel_size, int):
+        kernel_size = kernel_size[0] * kernel_size[1]
+    return ivy.pow(ivy.multiply(out, kernel_size), ivy.divide(1.0, norm_type))


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_torch/test_pooling_functions.py b/ivy_tests/test_ivy/test_frontends/test_torch/test_pooling_functions.py
--- a/ivy_tests/test_ivy/test_frontends/test_torch/test_pooling_functions.py
+++ b/ivy_tests/test_ivy/test_frontends/test_torch/test_pooling_functions.py
@@ -269,3 +269,43 @@ def test_torch_lp_pool1d(
         stride=stride[0],
         ceil_mode=False,
     )
+
+
+# avg_pool2d
+@handle_frontend_test(
+    fn_tree="torch.nn.functional.lp_pool2d",
+    dtype_x_k_s=helpers.arrays_for_pooling(
+        min_dims=4,
+        max_dims=4,
+        min_side=1,
+        max_side=4,
+    ),
+    norm_type=helpers.number(min_value=0.1, max_value=6),
+    test_with_out=st.just(False),
+)
+def test_torch_lp_pool2d(
+    dtype_x_k_s,
+    norm_type,
+    *,
+    test_flags,
+    frontend,
+    fn_tree,
+    on_device,
+):
+    input_dtype, x, kernel_size, stride, _ = dtype_x_k_s
+    # Torch ground truth func expects input to be consistent
+    # with a channels first format i.e. NCW
+    x[0] = x[0].transpose((0, 3, 1, 2))
+
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        test_flags=test_flags,
+        frontend=frontend,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        input=x[0],
+        norm_type=norm_type if norm_type > 0 else 1,
+        kernel_size=kernel_size,
+        stride=stride[0],
+        ceil_mode=False,
+    )
Repository: ivy-llc/ivy

Issue:
rand_like



Discussion:

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
@@ -76,6 +76,27 @@ def rand(
     )
 
 
+@to_ivy_arrays_and_back
+def rand_like(
+    input,
+    *,
+    dtype=None,
+    layout=None,
+    device=None,
+    requires_grad=False,
+    memory_format=False
+):
+    shape = input.shape
+    if not dtype:
+        dtype = input.dtype
+
+    return ivy.random_uniform(
+        shape=shape,
+        dtype=dtype,
+        device=device,
+    )
+
+
 @to_ivy_arrays_and_back
 def randn(
     size,


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
@@ -164,6 +164,44 @@ def call():
         assert u.shape == v.shape
 
 
+@handle_frontend_test(
+    fn_tree="torch.rand_like",
+    dtype=helpers.get_dtypes("float", full=False),
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float"),
+        min_num_dims=1,
+        max_num_dims=10,
+        min_dim_size=1,
+        max_dim_size=10,
+    ),
+)
+def test_torch_rand_like(dtype_and_x, dtype, *, frontend, fn_tree, test_flags):
+    input_dtype, input = dtype_and_x
+
+    def call():
+        return helpers.test_frontend_function(
+            input_dtypes=input_dtype,
+            frontend=frontend,
+            test_values=False,
+            fn_tree=fn_tree,
+            test_flags=test_flags,
+            input=input[0],
+            dtype=dtype[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
+
+
 @handle_frontend_test(
     fn_tree="torch.randn",
     dtype=helpers.get_dtypes("float", full=False),
Repository: ivy-llc/ivy

Issue:
xlogy



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
@@ -548,6 +548,24 @@ def softmax(logits, axis=-1):
     return ivy.softmax(logits, axis=axis)
 
 
+@with_supported_dtypes(
+    {
+        "2.12.0 and below": (
+            "bfloat16",
+            "half",
+            "float32",
+            "float64",
+            "complex64",
+            "complex128",
+        ),
+    },
+    "tensorflow",
+)
+@to_ivy_arrays_and_back
+def xlogy(x, y, name=None):
+    return ivy.xlogy(x, y)
+    
+   
 @to_ivy_arrays_and_back
 def cosh(x, name=None):
     return ivy.cosh(x)
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
@@ -575,12 +575,7 @@ def Xlog1py(*, x, y, name="Xlog1py"):
     return ivy.multiply(x, ivy.log1p(y))
 
 
-@to_ivy_arrays_and_back
-@with_unsupported_dtypes({"2.10.0 and below": ("bfloat16")}, "tensorflow")
-def Xlogy(*, x, y, name="Xlogy"):
-    if (x == 0).all():
-        return 0.0
-    return ivy.multiply(x, ivy.log(y))
+Xlogy = to_ivy_arrays_and_back(map_raw_ops_alias(tf_frontend.math.xlogy))
 
 
 @to_ivy_arrays_and_back


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
@@ -2025,6 +2025,38 @@ def test_tensorflow_softmax(
     )
 
 
+
+# xlogy
+@handle_frontend_test(
+    fn_tree="tensorflow.math.xlogy",
+    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_xlogy(
+    *,
+    dtype_and_x,
+    frontend,
+    test_flags,
+    fn_tree,
+    on_device,
+ ):
+  input_dtype, xs = 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=xs[0],
+      y=xs[1],
+  )
+  
+
+
 # cosh
 @handle_frontend_test(
     fn_tree="tensorflow.math.cosh",
@@ -2041,12 +2073,13 @@ def test_tensorflow_cosh(
     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],
-    )
+  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:
cosh



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
@@ -545,3 +545,8 @@ def sinh(x, name=None):
 @to_ivy_arrays_and_back
 def softmax(logits, axis=-1):
     return ivy.softmax(logits, axis=axis)
+
+
+@to_ivy_arrays_and_back
+def cosh(x, name=None):
+    return ivy.cosh(x)
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
@@ -133,6 +133,9 @@ def Concat(*, concat_dim, values, name="Concat"):
 Cos = to_ivy_arrays_and_back(map_raw_ops_alias(tf_frontend.math.cos))
 
 
+Cosh = to_ivy_arrays_and_back(map_raw_ops_alias(tf_frontend.math.cosh))
+
+
 @to_ivy_arrays_and_back
 def Cross(*, a, b, name="Cross"):
     a, b = check_tensorflow_casting(a, b)


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
@@ -2023,3 +2023,31 @@ def test_tensorflow_softmax(
         on_device=on_device,
         logits=x[0],
     )
+
+
+# cosh
+@handle_frontend_test(
+    fn_tree="tensorflow.math.cosh",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float_and_complex"),
+    ),
+    test_with_out=st.just(False),
+)
+def test_tensorflow_cosh(
+    *,
+    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],
+    )
+
Repository: ivy-llc/ivy

Issue:
polyder



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/jax/numpy/mathematical_functions.py b/ivy/functional/frontends/jax/numpy/mathematical_functions.py
--- a/ivy/functional/frontends/jax/numpy/mathematical_functions.py
+++ b/ivy/functional/frontends/jax/numpy/mathematical_functions.py
@@ -6,6 +6,7 @@
 from ivy.func_wrapper import with_unsupported_dtypes
 from ivy.functional.frontends.jax.numpy import promote_types_of_jax_inputs
 from ivy.functional.frontends.numpy.manipulation_routines import trim_zeros
+from math import factorial
 
 
 @to_ivy_arrays_and_back
@@ -556,6 +557,32 @@ def polyadd(a1, a2):
     return a1 + a2
 
 
+@with_unsupported_dtypes(
+    {"0.3.14 and below": ("float16",)},
+    "jax",
+)
+@to_ivy_arrays_and_back
+def polyder(p, m=1):
+    p = ivy.atleast_1d(p)
+    n = p.size
+
+    if m < 0:
+        raise ValueError("Order of derivative must be positive.")
+
+    if m == 0:
+        return p
+
+    if n == 1 or m >= n:
+        return ivy.array(0, dtype=p.dtype)
+
+    result = ivy.array([
+        factorial(n - 1 - k) // factorial(n - 1 - k - m) * p[k]
+        for k in range(n - m)
+    ], dtype=p.dtype)
+
+    return result
+
+
 @to_ivy_arrays_and_back
 def polysub(a1, a2):
     n = max(a1.size, a2.size) - 1


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_numpy_math.py b/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_numpy_math.py
--- a/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_numpy_math.py
+++ b/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_numpy_math.py
@@ -2642,6 +2642,39 @@ def test_jax_numpy_polyadd(
     )
 
 
+# polyder
+@handle_frontend_test(
+    fn_tree="jax.numpy.polyder",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float"),
+        num_arrays=1,
+        min_num_dims=1,
+        max_num_dims=1,
+        min_dim_size=1,
+    ),
+    m=st.integers(min_value=0, max_value=10),
+)
+def test_jax_numpy_polyder(
+        *,
+        dtype_and_x,
+        m,
+        test_flags,
+        on_device,
+        fn_tree,
+        frontend,
+):
+    input_dtype, x = dtype_and_x
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        test_flags=test_flags,
+        frontend=frontend,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        p=x[0],
+        m=m,
+    )
+
+
 # polysub
 @handle_frontend_test(
     fn_tree="jax.numpy.polysub",