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

Issue:
beta



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/jax/random.py b/ivy/functional/frontends/jax/random.py
--- a/ivy/functional/frontends/jax/random.py
+++ b/ivy/functional/frontends/jax/random.py
@@ -1,5 +1,6 @@
 # local
 import ivy
+from ivy.func_wrapper import with_unsupported_dtypes
 from ivy.functional.frontends.jax.func_wrapper import (
     to_ivy_arrays_and_back,
     handle_jax_dtype,
@@ -23,3 +24,24 @@ def uniform(key, shape=(), dtype=None, minval=0.0, maxval=1.0):
 @to_ivy_arrays_and_back
 def normal(key, shape=(), dtype=None):
     return ivy.random_normal(shape=shape, dtype=dtype, seed=ivy.to_scalar(key[1]))
+
+
+def _get_seed(key):
+    key1, key2 = int(key[0]), int(key[1])
+    return ivy.to_scalar(int("".join(map(str, [key1, key2]))))
+
+
+@handle_jax_dtype
+@to_ivy_arrays_and_back
+@with_unsupported_dtypes(
+    {
+        "0.3.14 and below": (
+            "float16",
+            "bfloat16",
+        )
+    },
+    "jax",
+)
+def beta(key, a, b, shape=None, dtype=None):
+    seed = _get_seed(key)
+    return ivy.beta(a, b, shape=shape, dtype=dtype, seed=seed)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_random.py b/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_random.py
--- a/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_random.py
+++ b/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_random.py
@@ -122,3 +122,63 @@ 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="jax.random.beta",
+    dtype_key=helpers.dtype_and_values(
+            available_dtypes=["uint32"],
+            min_value=0,
+            max_value=2000,
+            min_num_dims=1,
+            max_num_dims=1,
+            min_dim_size=2,
+            max_dim_size=2,
+        ),
+    alpha=st.floats(min_value=0, max_value=5, exclude_min=True),
+    beta=st.floats(min_value=0, max_value=5, exclude_min=True),
+    shape=helpers.get_shape(
+            min_num_dims=2, max_num_dims=2, min_dim_size=1, max_dim_size=5
+        ),
+    dtype = helpers.get_dtypes("float", full=False),
+    test_with_out=st.just(False),
+)
+def test_jax_beta(
+    *,
+    dtype_key,
+    alpha,
+    beta,
+    shape,
+    dtype,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+):
+    input_dtype, key=dtype_key
+    def call():
+        return helpers.test_frontend_function(
+            input_dtypes=input_dtype,
+            frontend=frontend,
+            test_flags=test_flags,
+            fn_tree=fn_tree,
+            on_device=on_device,
+            test_values=False,
+            key=key[0],
+            a=alpha,
+            b=beta,
+            shape=shape,
+            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
Repository: ivy-llc/ivy

Issue:
Add torch.Tensor.mul



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
@@ -890,3 +890,6 @@ def cumprod(self, dim, dtype):
     @with_unsupported_dtypes({"1.11.0 and below": ("bfloat16",)}, "torch")
     def exp(self, *, out=None):
         return torch_frontend.exp(self._ivy_array)
+    
+    def mul(self, other, *, out=None):
+        return torch_frontend.mul(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
@@ -6026,3 +6026,39 @@ def test_torch_instance_exp(
         frontend=frontend,
         on_device=on_device,
     )
+
+
+# mul
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="torch.tensor",
+    method_name="mul",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("numeric"),
+        num_arrays=2,
+    ),
+)
+def test_torch_instance_mul(
+    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:
from_dlpack



Discussion:

Resolving patch:
diff --git a/ivy/functional/backends/tensorflow/creation.py b/ivy/functional/backends/tensorflow/creation.py
--- a/ivy/functional/backends/tensorflow/creation.py
+++ b/ivy/functional/backends/tensorflow/creation.py
@@ -222,6 +222,8 @@ def from_dlpack(
     *,
     out: Optional[Union[tf.Tensor, tf.Variable]] = None,
 ) -> Union[tf.Tensor, tf.Variable]:
+    if isinstance(x, tf.Variable):
+        x = x.read_value()
     dlcapsule = tf.experimental.dlpack.to_dlpack(x)
     return tf.experimental.dlpack.from_dlpack(dlcapsule)
 
diff --git a/ivy/functional/frontends/torch/creation_ops.py b/ivy/functional/frontends/torch/creation_ops.py
--- a/ivy/functional/frontends/torch/creation_ops.py
+++ b/ivy/functional/frontends/torch/creation_ops.py
@@ -204,6 +204,11 @@ def eye(
     return ret
 
 
+@to_ivy_arrays_and_back
+def from_dlpack(ext_tensor):
+    return ivy.from_dlpack(ext_tensor)
+
+
 @to_ivy_arrays_and_back
 def empty_like(
     input,


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_torch/test_creation_ops.py b/ivy_tests/test_ivy/test_frontends/test_torch/test_creation_ops.py
--- a/ivy_tests/test_ivy/test_frontends/test_torch/test_creation_ops.py
+++ b/ivy_tests/test_ivy/test_frontends/test_torch/test_creation_ops.py
@@ -632,3 +632,29 @@ def test_torch_asarray(
         dtype=dtype[0],
         device=on_device,
     )
+
+
+# from_dlpack
+@handle_frontend_test(
+    fn_tree="torch.from_dlpack",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("numeric")
+    ),
+)
+def test_torch_from_dlpack(
+    *,
+    dtype_and_x,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+):
+    input_dtype, x = dtype_and_x
+    helpers.test_frontend_function(
+        ext_tensor=x[0],
+        input_dtypes=input_dtype,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+    )
diff --git a/ivy_tests/test_ivy/test_functional/test_core/test_creation.py b/ivy_tests/test_ivy/test_functional/test_core/test_creation.py
--- a/ivy_tests/test_ivy/test_functional/test_core/test_creation.py
+++ b/ivy_tests/test_ivy/test_functional/test_core/test_creation.py
@@ -397,7 +397,6 @@ def test_eye(
         max_dim_size=5,
     ),
     container_flags=st.just([False]),
-    as_variable_flags=st.just([False]),  # can't convert variables
     test_gradients=st.just(False),
 )
 def test_from_dlpack(
Repository: ivy-llc/ivy

Issue:
logical_or
- [ ] #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
@@ -189,6 +189,11 @@ def logical_xor(x, y, name="LogicalXor"):
     return ivy.logical_xor(x, y)
 
 
+@to_ivy_arrays_and_back
+def logical_or(x, y, name="logical_or"):
+    return ivy.logical_or(x, y)
+
+
 @to_ivy_arrays_and_back
 def multiply(x, y, name=None):
     x, y = check_tensorflow_casting(x, y)
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
@@ -19,11 +19,6 @@ def Acos(*, x, name="Acos"):
     return ivy.acos(x)
 
 
-@to_ivy_arrays_and_back
-def Acosh(*, x, name="Acosh"):
-    return ivy.acosh(x)
-
-
 Acosh = to_ivy_arrays_and_back(map_raw_ops_alias(tf_frontend.math.acosh))
 
 
@@ -272,10 +267,7 @@ def Log1p(*, x, name="Log1p"):
     return ivy.log1p(x)
 
 
-@to_ivy_arrays_and_back
-def LogicalOr(*, x, y, name="LogicalOr"):
-    x, y = check_tensorflow_casting(x, y)
-    return ivy.logical_or(x, y)
+LogicalOr = to_ivy_arrays_and_back(map_raw_ops_alias(tf_frontend.math.logical_or))
 
 
 @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
@@ -385,6 +385,36 @@ def test_tensorflow_logical_and(
     )
 
 
+# logical_or
+@handle_frontend_test(
+    fn_tree="tensorflow.math.logical_or",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("bool"),
+        num_arrays=2,
+        shared_dtype=True,
+    ),
+    test_with_out=st.just(False),
+)
+def test_tensorflow_logical_or(
+    *,
+    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],
+    )
+
+    
 # log_sigmoid
 @handle_frontend_test(
     fn_tree="tensorflow.math.log_sigmoid",
Repository: ivy-llc/ivy

Issue:
torch.Tensor.t



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
@@ -602,6 +602,9 @@ def transpose(self, dim0, dim1):
     def transpose_(self, dim0, dim1):
         self._ivy_array = self.transpose(dim0, dim1).ivy_array
         return self
+    
+    def t(self):
+        return torch_frontend.t(self._ivy_array)
 
     def flatten(self, start_dim=0, end_dim=-1):
         return torch_frontend.flatten(self._ivy_array, start_dim, end_dim)


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
@@ -4263,6 +4263,40 @@ def test_torch_instance_transpose_(
     )
 
 
+# t
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="torch.tensor",
+    method_name="t",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("valid"),
+        shape=helpers.get_shape(min_num_dims=2, max_num_dims=2),
+    ),
+)
+def test_torch_instance_t(
+    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,
+    )
+
+
 # flatten
 @handle_frontend_method(
     class_tree=CLASS_TREE,
Repository: ivy-llc/ivy

Issue:
poisson



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/jax/random.py b/ivy/functional/frontends/jax/random.py
--- a/ivy/functional/frontends/jax/random.py
+++ b/ivy/functional/frontends/jax/random.py
@@ -62,3 +62,14 @@ def dirichlet(key, alpha, shape=None, dtype="float32"):
     seed = _get_seed(key)
     alpha = ivy.astype(alpha, dtype)
     return ivy.dirichlet(alpha, size=shape, dtype=dtype, seed=seed)
+
+
+@handle_jax_dtype
+@to_ivy_arrays_and_back
+@with_unsupported_dtypes(
+    {"0.3.14 and below": ("unsigned", "int8", "int16")},
+    "jax",
+)
+def poisson(key, lam, shape=None, dtype=None):
+    seed = _get_seed(key)
+    return ivy.poisson(lam, shape=shape, dtype=dtype, seed=seed)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_random.py b/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_random.py
--- a/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_random.py
+++ b/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_random.py
@@ -250,3 +250,61 @@ 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="jax.random.poisson",
+    dtype_key=helpers.dtype_and_values(
+        available_dtypes=["uint32"],
+        min_value=0,
+        max_value=2000,
+        min_num_dims=1,
+        max_num_dims=1,
+        min_dim_size=2,
+        max_dim_size=2,
+    ),
+    lam=st.floats(min_value=0, max_value=5, exclude_min=True),
+    shape=helpers.get_shape(
+        min_num_dims=2, max_num_dims=2, min_dim_size=1, max_dim_size=5
+    ),
+    dtype=helpers.get_dtypes("integer", full=False),
+    test_with_out=st.just(False),
+)
+def test_jax_poisson(
+    *,
+    dtype_key,
+    lam,
+    shape,
+    dtype,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+):
+    input_dtype, key = dtype_key
+
+    def call():
+        return helpers.test_frontend_function(
+            input_dtypes=input_dtype,
+            frontend=frontend,
+            test_flags=test_flags,
+            fn_tree=fn_tree,
+            on_device=on_device,
+            test_values=False,
+            key=key[0],
+            lam=lam,
+            shape=shape,
+            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
Repository: ivy-llc/ivy

Issue:
diag



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
@@ -371,3 +371,8 @@ def searchsorted(
 @to_ivy_arrays_and_back
 def atleast_3d(*tensors):
     return ivy.atleast_3d(*tensors)
+
+
+@to_ivy_arrays_and_back
+def diag(input, diagonal=0, *, out=None):
+    return ivy.diag(input, k=diagonal)


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
@@ -1262,3 +1262,33 @@ def test_torch_atleast_3d(
         on_device=on_device,
         **arys,
     )
+
+
+# diag
+@handle_frontend_test(
+    fn_tree="torch.diag",
+    dtype_and_values=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float"),
+        shape=st.shared(helpers.get_shape(min_num_dims=1, max_num_dims=2), key="shape"),
+    ),
+    diagonal=st.integers(min_value=-100, max_value=100),
+)
+def test_torch_diag(
+    *,
+    dtype_and_values,
+    diagonal,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+):
+    dtype, values = dtype_and_values
+    helpers.test_frontend_function(
+        input_dtypes=dtype,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        input=values[0],
+        diagonal=diagonal,
+    )
Repository: ivy-llc/ivy

Issue:
ptp



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/jax/numpy/statistical.py b/ivy/functional/frontends/jax/numpy/statistical.py
--- a/ivy/functional/frontends/jax/numpy/statistical.py
+++ b/ivy/functional/frontends/jax/numpy/statistical.py
@@ -420,3 +420,10 @@ def std(a, axis=None, dtype=None, out=None, ddof=0, keepdims=False, *, where=Non
 @to_ivy_arrays_and_back
 def corrcoef(x, y=None, rowvar=True):
     return ivy.corrcoef(x, y=y, rowvar=rowvar)
+
+
+@to_ivy_arrays_and_back
+def ptp(a, axis=None, out=None, keepdims=False):
+    x = ivy.max(a, axis=axis, keepdims=keepdims)
+    y = ivy.min(a, axis=axis, keepdims=keepdims)
+    return ivy.subtract(x, y)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_numpy_statistical.py b/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_numpy_statistical.py
--- a/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_numpy_statistical.py
+++ b/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_numpy_statistical.py
@@ -847,3 +847,31 @@ def test_jax_numpy_corrcoef(
         y=x[1],
         rowvar=rowvar,
     )
+
+
+# ptp
+@handle_frontend_test(
+    fn_tree="jax.numpy.ptp",
+    dtype_and_x_axis_dtype=_get_castable_dtypes_values(allow_nan=False),
+    keep_dims=st.booleans(),
+)
+def test_jax_numpy_ptp(
+    dtype_and_x_axis_dtype,
+    frontend,
+    test_flags,
+    fn_tree,
+    on_device,
+    keep_dims,
+):
+    input_dtypes, x, axis, dtype = dtype_and_x_axis_dtype
+    np_frontend_helpers.test_frontend_function(
+        input_dtypes=input_dtypes,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        a=x[0],
+        axis=axis,
+        out=None,
+        keepdims=keep_dims
+    )
Repository: ivy-llc/ivy

Issue:
lp_pool1d



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
@@ -157,3 +157,37 @@ def adaptive_avg_pool1d(input, output_size):
 @to_ivy_arrays_and_back
 def adaptive_avg_pool2d(input, output_size):
     return ivy.adaptive_avg_pool2d(input, output_size)
+
+
+@with_unsupported_dtypes(
+    {
+        "1.11.0 and below": (
+            "float16",
+            "bfloat16",
+        )
+    },
+    "torch",
+)
+@to_ivy_arrays_and_back
+def lp_pool1d(input, norm_type, kernel_size, stride=None, ceil_mode=False):
+
+    data_format = "NCW"
+    padding = "VALID"
+    if stride is not None:
+        out = ivy.avg_pool1d(
+            ivy.pow(input, norm_type),
+            kernel_size,
+            stride,
+            padding,
+            data_format=data_format,
+        )
+    else:
+        out = ivy.avg_pool1d(
+            ivy.pow(input, norm_type),
+            kernel_size,
+            kernel_size,
+            padding,
+            data_format=data_format,
+        )
+
+    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
@@ -228,3 +228,44 @@ def test_torch_adaptive_avg_pool2d(
         output_size=output_size,
         atol=1e-2,
     )
+
+
+# avg_pool1d
+@handle_frontend_test(
+    fn_tree="torch.nn.functional.lp_pool1d",
+    dtype_x_k_s=helpers.arrays_for_pooling(
+        min_dims=3,
+        max_dims=3,
+        min_side=1,
+        max_side=3,
+    ),
+    norm_type=helpers.number(min_value=0.1, max_value=6),
+    test_with_out=st.just(False),
+)
+def test_torch_lp_pool1d(
+    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].reshape((x[0].shape[0], x[0].shape[-1], x[0].shape[1]))
+
+    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[0],
+        stride=stride[0],
+        ceil_mode=False,
+    )
Repository: ivy-llc/ivy

Issue:
poly



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
@@ -526,3 +526,20 @@ def frexp(x, /):
 @to_ivy_arrays_and_back
 def ldexp(x1, x2, /):
     return ivy.ldexp(x1, x2)
+
+
+@to_ivy_arrays_and_back
+def poly(seq_of_zeros):
+    seq_of_zeros = ivy.atleast_1d(seq_of_zeros)
+    sh = seq_of_zeros.shape
+    if len(sh) == 2 and sh[0] == sh[1] and sh[0] != 0:
+        seq_of_zeros = ivy.eigvals(seq_of_zeros)
+    if seq_of_zeros.ndim != 1:
+        raise ValueError("input must be 1d or non-empty square 2d array.")
+    dt = seq_of_zeros.dtype
+    if len(seq_of_zeros) == 0:
+        return ivy.ones((), dtype=dt)
+    a = ivy.ones((1,), dtype=dt)
+    for k in range(len(seq_of_zeros)):
+        a = convolve(a, ivy.asarray([ivy.array(1), -seq_of_zeros[k]], dtype=dt), mode='full')
+    return a


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
@@ -2576,3 +2576,35 @@ def test_jax_numpy_ldexp(
         x1=x[0],
         x2=x[1],
     )
+
+
+# poly
+@handle_frontend_test(
+    fn_tree="jax.numpy.poly",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float"),
+        num_arrays=1,
+        min_num_dims=1,
+        max_num_dims=1,
+    ),
+)
+def test_jax_numpy_poly(
+    *,
+    dtype_and_x,
+    test_flags,
+    on_device,
+    fn_tree,
+    frontend,
+):
+    input_dtype, x = dtype_and_x
+    assume("float16" not in input_dtype)
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        test_flags=test_flags,
+        frontend=frontend,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        seq_of_zeros=x[0],
+        atol=1e-05,
+        rtol=1e-03
+    )