diff --git a/ivy/functional/frontends/paddle/tensor/manipulation.py b/ivy/functional/frontends/paddle/tensor/manipulation.py index 7d0fa71ebe270..18de57a78386c 100644 --- a/ivy/functional/frontends/paddle/tensor/manipulation.py +++ b/ivy/functional/frontends/paddle/tensor/manipulation.py @@ -169,3 +169,14 @@ def take_along_axis(arr, indices, axis): @to_ivy_arrays_and_back def rot90(x, k=1, axes=(0, 1), name=None): return ivy.rot90(x, k=k, axes=axes) + + +@with_supported_dtypes( + { + "2.5.0 and below": ("float32", "float64", "int32", "int64", "bool") + }, + "paddle", +) +@to_ivy_arrays_and_back +def resharp_(x, shape, name=None): + return ivy.reshape(x, shape, name=name) diff --git a/ivy/functional/frontends/paddle/tensor/stat.py b/ivy/functional/frontends/paddle/tensor/stat.py index a97120e4e3d12..5ab748003ec66 100644 --- a/ivy/functional/frontends/paddle/tensor/stat.py +++ b/ivy/functional/frontends/paddle/tensor/stat.py @@ -32,7 +32,12 @@ def nanquantile(a, q, axis=None, keepdims=False, interpolation="linear", out=Non a, q, axis=axis, keepdims=keepdims, interpolation=interpolation, out=out ) - +@with_unsupported_dtypes({"2.4.2 and below": ("float16", "bfloat16")}, "paddle") +) +@to_ivy_arrays_and_back +def quantile(x, q, axis=None, keepdims=False, name=None, out=None): + return ivy.quantile(x, q, axis=axis, keepdims=keepdims, out=out) + @with_supported_dtypes( {"2.5.1 and below": ("bool", "float16", "float32", "float64", "int32", "int64")}, "paddle", diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_manipulation.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_manipulation.py index b28dfbc686720..ce641c485023d 100644 --- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_manipulation.py +++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_manipulation.py @@ -674,3 +674,27 @@ def test_paddle_rot90( k=k, axes=tuple(axes), ) + +@handle_frontend_test( + fn_tree="paddle.resharp_", + dtype_x_and_shape=_reshape_helper() +) +def test_paddle_resharp_( + *, + dtype_x_and_shape, + on_device, + fn_tree, + frontend, + test_flags, +): + input_dtype, x, shape = dtype_x_and_shape + helpers.test_frontend_function( + input_dtypes=input_dtype, + backend_to_test=backend_fw, + frontend=frontend, + test_flags=test_flags, + fn_tree=fn_tree, + on_device=on_device, + x=x[0], + shape=shape, + ) diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_stat.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_stat.py index f3c4fa485b3ca..f49840fc50063 100644 --- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_stat.py +++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_stat.py @@ -193,3 +193,32 @@ def test_paddle_nanmedian( axis=axis, keepdim=keepdim, ) + +@handle_frontend_test( + fn_tree="paddle.quantile", + dtype_and_x=_statistical_dtype_values(function="quantile"), + keepdims=st.booleans(), + q=st.floats(0.0, 1.0), +) +def test_paddle_quantile( + *, + q, + dtype_and_x, + keepdims, + frontend, + test_flags, + fn_tree, + on_device, +): + input_dtypes, x, axis = dtype_and_x + helpers.test_frontend_function( + input_dtypes=input_dtypes, + frontend=frontend, + test_flags=test_flags, + fn_tree=fn_tree, + on_device=on_device, + x=x[0], + q=q, + axis=axis, + keepdims=keepdims, + )