diff --git a/ivy/functional/frontends/paddle/math.py b/ivy/functional/frontends/paddle/math.py index 3beb2568f1f90..f1be11ce36c7d 100644 --- a/ivy/functional/frontends/paddle/math.py +++ b/ivy/functional/frontends/paddle/math.py @@ -247,6 +247,14 @@ def floor_divide(x, y, name=None): return ivy.floor_divide(x, y) +@with_supported_dtypes( + {"2.5.1 and below": ("float32", "float64", "int32", "int64")}, "paddle" +) +@to_ivy_arrays_and_back +def floor_mod(x, y, name=None): + return ivy.remainder(x, y) + + @with_unsupported_dtypes({"2.5.1 and below": "bfloat16"}, "paddle") @to_ivy_arrays_and_back def fmax(x, y, name=None): diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_math.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_math.py index a57a5c0a41c22..0ab5854baf78c 100644 --- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_math.py +++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_math.py @@ -995,6 +995,42 @@ def test_paddle_floor_divide( ) +# floor_mod +@handle_frontend_test( + fn_tree="paddle.floor_mod", + dtype_and_x=helpers.dtype_and_values( + available_dtypes=helpers.get_dtypes("valid"), + num_arrays=2, + allow_inf=False, + large_abs_safety_factor=2, + small_abs_safety_factor=2, + safety_factor_scale="log", + shared_dtype=True, + min_value=1, + ), +) +def test_paddle_floor_mod( + *, + dtype_and_x, + on_device, + fn_tree, + frontend, + backend_fw, + test_flags, +): + input_dtype, x = dtype_and_x + helpers.test_frontend_function( + input_dtypes=input_dtype, + frontend=frontend, + backend_to_test=backend_fw, + test_flags=test_flags, + fn_tree=fn_tree, + on_device=on_device, + x=x[0], + y=x[1], + ) + + @handle_frontend_test( fn_tree="paddle.fmax", dtypes_and_x=helpers.dtype_and_values(