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

Issue:
fftshift



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/fft.py b/ivy/functional/frontends/paddle/fft.py
--- a/ivy/functional/frontends/paddle/fft.py
+++ b/ivy/functional/frontends/paddle/fft.py
@@ -14,3 +14,33 @@
 def fft(x, n=None, axis=-1.0, norm="backward", name=None):
     ret = ivy.fft(ivy.astype(x, "complex128"), axis, norm=norm, n=n)
     return ivy.astype(ret, x.dtype)
+
+
+@with_supported_dtypes(
+    {
+        "2.5.0 and below": (
+            "int32",
+            "int64",
+            "float32",
+            "float64",
+            "complex64",
+            "complex128",
+        )
+    },
+    "paddle",
+)
+@to_ivy_arrays_and_back
+def fftshift(x, axes=None, name=None):
+    shape = x.shape
+
+    if axes is None:
+        axes = tuple(range(x.ndim))
+        shifts = [(dim // 2) for dim in shape]
+    elif isinstance(axes, int):
+        shifts = shape[axes] // 2
+    else:
+        shifts = ivy.concat([shape[ax] // 2 for ax in axes])
+
+    roll = ivy.roll(x, shifts, axis=axes)
+
+    return roll


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_paddle_fft.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_paddle_fft.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_paddle_fft.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_paddle_fft.py
@@ -42,3 +42,28 @@ def test_paddle_fft(
         axis=axis,
         norm=norm,
     )
+
+
+@handle_frontend_test(
+    fn_tree="paddle.fft.fftshift",
+    dtype_x_axis=helpers.dtype_values_axis(
+        available_dtypes=helpers.get_dtypes("valid"),
+        min_value=-10,
+        max_value=10,
+        min_num_dims=1,
+        valid_axis=True,
+        force_int_axis=True,
+    ),
+)
+def test_paddle_fttshift(dtype_x_axis, frontend, test_flags, fn_tree, on_device):
+    input_dtype, x, axes = dtype_x_axis
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        test_values=True,
+        x=x[0],
+        axes=axes,
+    )
Repository: ivy-llc/ivy

Issue:
linear
#15051 


Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/nn/functional/common.py b/ivy/functional/frontends/paddle/nn/functional/common.py
--- a/ivy/functional/frontends/paddle/nn/functional/common.py
+++ b/ivy/functional/frontends/paddle/nn/functional/common.py
@@ -85,3 +85,10 @@ def zeropad2d(x, padding, data_format="NCHW", name=None):
     else:
         raise ValueError("Unknown data_format: {}".format(data_format))
     return ivy.pad(x, padding, mode="constant", constant_values=0.0)
+
+
+@to_ivy_arrays_and_back
+@with_supported_dtypes({"2.5.0 and below": ("float32", "float64")}, "paddle")
+def linear(x, weight, bias=None, name=None):
+    weight = ivy.swapaxes(weight, -1, -2)
+    return ivy.linear(x, weight, bias=bias)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_nn/test_functional/test_common.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_nn/test_functional/test_common.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_nn/test_functional/test_common.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_nn/test_functional/test_common.py
@@ -2,8 +2,12 @@
 from hypothesis import strategies as st
 
 # local
+import ivy
 import ivy_tests.test_ivy.helpers as helpers
 from ivy_tests.test_ivy.helpers import handle_frontend_test
+from ivy_tests.test_ivy.test_frontends.test_torch.test_linear_functions import (
+    x_and_linear,
+)
 
 
 # Cosine Similarity
@@ -186,3 +190,32 @@ def test_paddle_zeropad2d(
         padding=padding,
         data_format=dataformat,
     )
+
+ 
+# linear
+@handle_frontend_test(
+    fn_tree="paddle.nn.functional.common.linear",
+    dtype_x_weight_bias=x_and_linear(
+        dtypes=helpers.get_dtypes("valid", full=False),
+    ),
+)
+def test_linear(
+    *,
+    dtype_x_weight_bias,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+):
+    dtype, x, weight, bias = dtype_x_weight_bias
+    weight = ivy.swapaxes(weight, -1, -2)
+    helpers.test_frontend_function(
+        input_dtypes=dtype,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        x=x,
+        weight=weight,
+        bias=bias,
+    )
Repository: ivy-llc/ivy

Issue:
sgn



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
@@ -317,3 +317,9 @@ def minimum(x, y, name=None):
 @to_ivy_arrays_and_back
 def trunc(x, name=None):
     return ivy.trunc(x)
+
+
+@with_unsupported_dtypes({"2.5.0 and below": ("float16", "bfloat16")}, "paddle")
+@to_ivy_arrays_and_back
+def sgn(x, name=None):
+    return ivy.sign(x)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_math.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_math.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_math.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_math.py
@@ -1324,3 +1324,28 @@ def test_paddle_trunc(
         on_device=on_device,
         x=x[0],
     )
+
+
+@handle_frontend_test(
+    fn_tree="paddle.tensor.math.sgn",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float"),
+    ),
+)
+def test_paddle_sgn(
+    *,
+    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,
+        x=x[0],
+    )
Repository: ivy-llc/ivy

Issue:
 unique_with_counts



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
@@ -13,7 +13,7 @@
 import ivy.functional.frontends.tensorflow as tf_frontend
 from ivy.functional.frontends.tensorflow import check_tensorflow_casting
 import functools
-
+import collections
 
 @to_ivy_arrays_and_back
 def argsort(values, axis=-1, direction="ASCENDING", stable=False, name=None):
@@ -577,6 +577,32 @@ def unique(x, out_idx=ivy.int32, name=None):
     return y, idx
 
 
+@to_ivy_arrays_and_back
+def unique_with_counts(x, out_idx="int32", name=None):
+
+    x = x.to_list() if ivy.is_array(x) else x
+
+    ivy.utils.assertions.check_equal(ivy.array(x).ndim, 1, message="unique_with_counts expects a 1D vector.",)
+    ivy.utils.assertions.check_elem_in_list(out_idx, ["int32", "int64"], message=f"Value for attr 'out_idx' of {out_idx} is not in the list of allowed values: [int32, int64]",)
+
+    values = []
+    indices = []
+    counts = []
+    
+    for element in x:
+        if element not in values:
+            values.append(element)
+            indices.append(len(values) - 1)
+            counts.append(1)
+        else:
+            index = values.index(element)
+            counts[index] += 1
+            indices.append(index)
+    
+    return (ivy.array(values), ivy.array(indices, dtype=out_idx), ivy.array(counts, dtype=out_idx))
+
+
+
 @to_ivy_arrays_and_back
 def while_loop(
     cond,


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
@@ -2,6 +2,7 @@
 from hypothesis import strategies as st, assume
 import numpy as np
 from tensorflow import errors as tf_errors
+import ivy
 
 # local
 import ivy_tests.test_ivy.helpers as helpers
@@ -2037,6 +2038,36 @@ def test_tensorflow_unique(
     )
 
 
+@handle_frontend_test(
+    fn_tree="tensorflow.unique_with_counts",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("valid"),
+        shape=st.shared(helpers.get_shape(min_num_dims=1, max_num_dims=1,)),
+        dtype=["int32", "int64"],
+    ),
+    output_dtype=st.sampled_from(["int32", "int64"]),
+)
+def test_tensorflow_unique_with_counts(
+    *,
+    dtype_and_x,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+    output_dtype,
+):
+    input_dtype, x = dtype_and_x
+    helpers.test_frontend_function(
+        x=x[0],
+        input_dtypes=input_dtype,
+        out_idx=output_dtype,
+        fn_tree=fn_tree,
+        frontend=frontend,
+        test_flags=test_flags,
+        on_device=on_device,
+    )
+
+
 @handle_frontend_test(
     fn_tree="tensorflow.while_loop",
     dtype_and_x=helpers.dtype_and_values(
Repository: ivy-llc/ivy

Issue:
dot



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
@@ -971,6 +971,10 @@ def addr_(self, vec1, vec2, *, beta=1, alpha=1):
         self.ivy_array = self.addr(vec1, vec2, beta=beta, alpha=alpha).ivy_array
         return self
 
+    @with_unsupported_dtypes({"2.0.1 and below": ("float16", "bfloat16")}, "torch")
+    def dot(self, tensor):
+        return torch_frontend.dot(self, tensor)
+
     # Special Methods #
     # -------------------#
 


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py b/ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py
--- a/ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py
+++ b/ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py
@@ -9883,3 +9883,39 @@ def test_torch_instance_heaviside(
         frontend=frontend,
         on_device=on_device,
     )
+
+
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="torch.tensor",
+    method_name="dot",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float"),
+        num_arrays=2,
+        shape=(1,),
+    ),
+)
+def test_torch_instance_dot(
+    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={
+            "tensor": 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:
sign



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/tensor/tensor.py b/ivy/functional/frontends/paddle/tensor/tensor.py
--- a/ivy/functional/frontends/paddle/tensor/tensor.py
+++ b/ivy/functional/frontends/paddle/tensor/tensor.py
@@ -494,3 +494,7 @@ def conj(self, name=None):
     )
     def logical_not(self, out=None, name=None):
         return ivy.logical_not(self.ivy_array)
+
+    @with_unsupported_dtypes({"2.5.0 and below": ("float16", "bfloat16")}, "paddle")
+    def sign(self, name=None):
+        return ivy.sign(self._ivy_array)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_tensor.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_tensor.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_tensor.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_tensor.py
@@ -2328,3 +2328,35 @@ def test_paddle_logical_not(
         frontend=frontend,
         on_device=on_device,
     )
+
+
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="paddle.to_tensor",
+    method_name="sign",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float"),
+    ),
+)
+def test_paddle_sign(
+    dtype_and_x,
+    frontend_method_data,
+    init_flags,
+    method_flags,
+    frontend,
+    on_device,
+):
+    input_dtype, x = dtype_and_x
+    helpers.test_frontend_method(
+        init_input_dtypes=input_dtype,
+        init_all_as_kwargs_np={
+            "data": x[0],
+        },
+        method_input_dtypes=input_dtype,
+        method_all_as_kwargs_np={},
+        frontend_method_data=frontend_method_data,
+        init_flags=init_flags,
+        method_flags=method_flags,
+        frontend=frontend,
+        on_device=on_device,
+    )
Repository: ivy-llc/ivy

Issue:
compress



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/numpy/indexing_routines/indexing_like_operations.py b/ivy/functional/frontends/numpy/indexing_routines/indexing_like_operations.py
--- a/ivy/functional/frontends/numpy/indexing_routines/indexing_like_operations.py
+++ b/ivy/functional/frontends/numpy/indexing_routines/indexing_like_operations.py
@@ -2,6 +2,7 @@
 from ivy.functional.frontends.numpy.func_wrapper import (
     to_ivy_arrays_and_back,
     inputs_to_ivy_arrays,
+    handle_numpy_out,
 )
 
 
@@ -78,3 +79,22 @@ def diag(v, k=0):
 @to_ivy_arrays_and_back
 def diagonal(a, offset, axis1, axis2):
     return ivy.diagonal(a, offset=offset, axis1=axis1, axis2=axis2)
+
+
+@to_ivy_arrays_and_back
+@handle_numpy_out
+def compress(condition, a, axis=None, out=None):
+    condition_arr = ivy.asarray(condition).astype(bool)
+    if condition_arr.ndim != 1:
+        raise ivy.utils.exceptions.IvyException("Condition must be a 1D array")
+    if axis is None:
+        arr = ivy.asarray(a).flatten()
+        axis = 0
+    else:
+        arr = ivy.moveaxis(a, axis, 0)
+    if condition_arr.shape[0] > arr.shape[0]:
+        raise ivy.utils.exceptions.IvyException(
+            "Condition contains entries that are out of bounds"
+        )
+    arr = arr[: condition_arr.shape[0]]
+    return ivy.moveaxis(arr[condition_arr], 0, axis)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_numpy/test_indexing_routines/test_indexing_like_operations.py b/ivy_tests/test_ivy/test_frontends/test_numpy/test_indexing_routines/test_indexing_like_operations.py
--- a/ivy_tests/test_ivy/test_frontends/test_numpy/test_indexing_routines/test_indexing_like_operations.py
+++ b/ivy_tests/test_ivy/test_frontends/test_numpy/test_indexing_routines/test_indexing_like_operations.py
@@ -139,3 +139,42 @@ def test_numpy_put_along_axis(
         axis=axis,
         values=values,
     )
+
+
+@handle_frontend_test(
+    fn_tree="numpy.compress",
+    dtype_arr_ax=helpers.dtype_values_axis(
+        available_dtypes=helpers.get_dtypes("valid"),
+        min_num_dims=1,
+        max_num_dims=5,
+        min_dim_size=10,
+        max_dim_size=100,
+        valid_axis=True,
+        force_int_axis=True,
+    ),
+    condition=helpers.array_values(
+        dtype=helpers.get_dtypes("bool"),
+        shape=helpers.get_shape(
+            min_num_dims=1, max_num_dims=1, min_dim_size=1, max_dim_size=5
+        ),
+    ),
+)
+def test_numpy_compress(
+    dtype_arr_ax,
+    condition,
+    frontend,
+    test_flags,
+    fn_tree,
+    on_device,
+):
+    dtype, arr, ax = dtype_arr_ax
+    helpers.test_frontend_function(
+        input_dtypes=dtype,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        condition=condition,
+        a=arr[0],
+        axis=ax,
+    )
Repository: ivy-llc/ivy

Issue:
max
max for paddle.tensor.math


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
@@ -338,3 +338,11 @@ def maximum(x, y, name=None):
 @to_ivy_arrays_and_back
 def frac(x, name=None):
     return x - ivy.sign(x) * ivy.floor(ivy.abs(x))
+
+
+@with_supported_dtypes(
+    {"2.5.0 and below": ("float32", "float64", "int32", "int64")}, "paddle"
+)
+@to_ivy_arrays_and_back
+def max(x, axis=None, keepdim=False, name=None):
+    return ivy.max(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
@@ -1409,3 +1409,35 @@ def test_paddle_frac(
         on_device=on_device,
         x=x[0],
     )
+
+
+# max
+@handle_frontend_test(
+    fn_tree="paddle.tensor.math.max",
+    dtype_and_x=helpers.dtype_values_axis(
+        available_dtypes=helpers.get_dtypes("valid"),
+        min_axis=-1,
+        max_axis=0,
+        min_num_dims=1,
+        force_int_axis=False,
+    ),
+)
+def test_paddle_max(
+    *,
+    dtype_and_x,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+):
+    input_dtype, x, axis = dtype_and_x
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        x=x[0],
+        axis=axis,
+        keepdim=False,
+    )
Repository: ivy-llc/ivy

Issue:
leaky_relu
Paddle Frontend


Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/nn/functional/activation.py b/ivy/functional/frontends/paddle/nn/functional/activation.py
--- a/ivy/functional/frontends/paddle/nn/functional/activation.py
+++ b/ivy/functional/frontends/paddle/nn/functional/activation.py
@@ -209,3 +209,8 @@ def elu(
 @to_ivy_arrays_and_back
 def mish(x, name=None):
     return ivy.mish(x)
+
+@with_supported_dtypes({"2.4.2 and below": ("float32", "float64")}, "paddle")
+@to_ivy_arrays_and_back
+def leaky_relu(x, negative_slope=0.01, name=None):
+    return ivy.leaky_relu(x)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_nn/test_functional/test_paddle_activation.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_nn/test_functional/test_paddle_activation.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_nn/test_functional/test_paddle_activation.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_nn/test_functional/test_paddle_activation.py
@@ -514,3 +514,29 @@ def test_paddle_mish(
         on_device=on_device,
         x=x[0],
     )
+
+
+@handle_frontend_test(
+    fn_tree="paddle.nn.functional.leaky_relu",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float"),
+    ),
+)
+def test_paddle_leaky_relu(
+    *,
+    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,
+        negative_slope=0.01,
+        x=x[0],
+    )
Repository: ivy-llc/ivy

Issue:
Sort



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/tensor/search.py b/ivy/functional/frontends/paddle/tensor/search.py
--- a/ivy/functional/frontends/paddle/tensor/search.py
+++ b/ivy/functional/frontends/paddle/tensor/search.py
@@ -33,6 +33,15 @@ def argsort(x, /, *, axis=-1, descending=False, name=None):
     return ivy.argsort(x, axis=axis, descending=descending)
 
 
+@with_supported_dtypes(
+    {"2.5.0 and below": ("float32", "float64", "int32", "int64")},
+    "paddle",
+)
+@to_ivy_arrays_and_back
+def sort(x, /, *, axis=-1, descending=False, name=None):
+    return ivy.sort(x, axis=axis, descending=descending)
+
+
 @with_supported_dtypes(
     {"2.4.2 and below": ("float32", "float64", "int16", "int32", "int64", "uint8")},
     "paddle",


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_search.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_search.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_search.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_search.py
@@ -99,6 +99,39 @@ def test_paddle_argsort(
     )
 
 
+# sort
+@handle_frontend_test(
+    fn_tree="paddle.tensor.search.sort",
+    dtype_input_axis=helpers.dtype_values_axis(
+        available_dtypes=helpers.get_dtypes("valid"),
+        min_num_dims=1,
+        valid_axis=True,
+        force_int_axis=True,
+    ),
+    descending=st.booleans(),
+)
+def test_paddle_sort(
+    *,
+    dtype_input_axis,
+    descending,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+):
+    input_dtype, x, axis = dtype_input_axis
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        x=x[0],
+        axis=axis,
+        descending=descending,
+    )
+
+
 # nonzero
 @handle_frontend_test(
     fn_tree="paddle.nonzero",
Repository: ivy-llc/ivy

Issue:
Numpy frontend resize function
### Bug Explanation

The parameter shape doesn't allow integer as input. Original np.resize allows integer as input for shape

### Steps to Reproduce Bug

```
import numpy as np
from ivy.functional.frontends.numpy.manipulation_routines import resize

x = np.array([1,2,3])
resize(x,10)
```

### Environment

Ubuntu 20.04

### Ivy Version

v1.1.9

### Backend

- [X] NumPy
- [ ] TensorFlow
- [ ] PyTorch
- [ ] JAX

### Device

_No response_


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
@@ -12,6 +12,8 @@ def reshape(x, /, newshape, order="C"):
 
 @to_ivy_arrays_and_back
 def resize(x, newshape, /, refcheck=True):
+    if isinstance(newshape, int):
+        newshape = (newshape,)
     x_new = ivy.reshape(x, shape=(-1,), order="C")
     total_size = 1
     for diff_size in newshape:


Test patch:
Repository: ivy-llc/ivy

Issue:
[Feature Request]: size attribute of numpy ndarray
**Is your feature request related to a problem? Please describe.**
size attribute needs to be added to ndarray class of numpy frontend




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
@@ -49,6 +49,10 @@ def T(self):
     def shape(self):
         return self.ivy_array.shape
 
+    @property
+    def size(self):
+        return self.ivy_array.size
+
     @property
     def dtype(self):
         return self.ivy_array.dtype


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
@@ -92,6 +92,21 @@ def test_numpy_ndarray_property_ndim(
     ivy.utils.assertions.check_equal(x.ndim, data[0].ndim, as_array=False)
 
 
+@given(
+    dtype_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("valid", prune_function=False),
+        ret_shape=True,
+    ),
+)
+def test_numpy_ndarray_property_size(
+    dtype_x,
+):
+    dtype, data, shape = dtype_x
+    x = ndarray(shape, dtype[0])
+    x.ivy_array = data[0]
+    ivy.utils.assertions.check_equal(x.size, data[0].size, as_array=False)
+
+
 @given(
     dtype_x=helpers.dtype_and_values(
         available_dtypes=helpers.get_dtypes("valid", prune_function=False),