diff --git a/ivy/data_classes/array/experimental/layers.py b/ivy/data_classes/array/experimental/layers.py index 8f0d453857800..743cd9023cb64 100644 --- a/ivy/data_classes/array/experimental/layers.py +++ b/ivy/data_classes/array/experimental/layers.py @@ -1336,6 +1336,7 @@ def adaptive_max_pool3d( """ Apply a 3D adaptive maximum pooling over an input signal composed of several input planes. + Parameters ---------- self diff --git a/ivy/data_classes/container/experimental/layers.py b/ivy/data_classes/container/experimental/layers.py index 140957fb8f75f..18086efa3f125 100644 --- a/ivy/data_classes/container/experimental/layers.py +++ b/ivy/data_classes/container/experimental/layers.py @@ -2869,6 +2869,7 @@ def static_adaptive_max_pool3d( ivy.Container static method variant of ivy.adaptive_max_pool3d. This method simply wraps the function, and so the docstring for ivy.adaptive_max_pool3d also applies to this method with minimal changes. + Parameters ---------- input @@ -2906,6 +2907,7 @@ def adaptive_max_pool3d( """ Apply a 3D adaptive maximum pooling over an input signal composed of several input planes. + Parameters ---------- self diff --git a/ivy/functional/ivy/experimental/layers.py b/ivy/functional/ivy/experimental/layers.py index 429e8178c2373..5cabe27919465 100644 --- a/ivy/functional/ivy/experimental/layers.py +++ b/ivy/functional/ivy/experimental/layers.py @@ -3232,6 +3232,7 @@ def adaptive_max_pool3d( """ Apply a 3D adaptive maximum pooling over an input signal composed of several input planes. + Parameters ---------- input diff --git a/ivy_tests/test_ivy/test_functional/test_experimental/test_nn/test_layers.py b/ivy_tests/test_ivy/test_functional/test_experimental/test_nn/test_layers.py index cf1d7625ee07f..8170cd26194a7 100644 --- a/ivy_tests/test_ivy/test_functional/test_experimental/test_nn/test_layers.py +++ b/ivy_tests/test_ivy/test_functional/test_experimental/test_nn/test_layers.py @@ -583,6 +583,44 @@ def test_adaptive_max_pool2d( ) +@handle_test( + fn_tree="functional.ivy.experimental.adaptive_max_pool3d", + dtype_and_x=helpers.dtype_and_values( + available_dtypes=helpers.get_dtypes("float"), + min_num_dims=4, + max_num_dims=5, + min_dim_size=1, + # Setting max and min value because this operation in paddle is not + # numerically stable + max_value=100, + min_value=-100, + ), + output_size=st.one_of( + st.tuples( + helpers.ints(min_value=1, max_value=5), + helpers.ints(min_value=1, max_value=5), + helpers.ints(min_value=1, max_value=5), + ), + helpers.ints(min_value=1, max_value=5), + ), + test_with_out=st.just(False), + ground_truth_backend="torch", +) +def test_adaptive_max_pool3d( + *, dtype_and_x, output_size, test_flags, backend_fw, fn_name, on_device +): + input_dtype, x = dtype_and_x + helpers.test_function( + input_dtypes=input_dtype, + test_flags=test_flags, + backend_to_test=backend_fw, + on_device=on_device, + fn_name=fn_name, + input=x[0], + output_size=output_size, + ) + + @handle_test( fn_tree="functional.ivy.experimental.avg_pool1d", x_k_s_p=helpers.arrays_for_pooling(min_dims=3, max_dims=3, min_side=1, max_side=4), @@ -1437,41 +1475,3 @@ def test_stft( window_fn=None, pad_end=True, ) - - -@handle_test( - fn_tree="functional.ivy.experimental.adaptive_max_pool3d", - dtype_and_x=helpers.dtype_and_values( - available_dtypes=helpers.get_dtypes("float"), - min_num_dims=4, - max_num_dims=5, - min_dim_size=1, - # Setting max and min value because this operation in paddle is not - # numerically stable - max_value=100, - min_value=-100, - ), - output_size=st.one_of( - st.tuples( - helpers.ints(min_value=1, max_value=5), - helpers.ints(min_value=1, max_value=5), - helpers.ints(min_value=1, max_value=5), - ), - helpers.ints(min_value=1, max_value=5), - ), - test_with_out=st.just(False), - ground_truth_backend="torch", -) -def test_adaptive_max_pool3d( - *, dtype_and_x, output_size, test_flags, backend_fw, fn_name, on_device -): - input_dtype, x = dtype_and_x - helpers.test_function( - input_dtypes=input_dtype, - test_flags=test_flags, - backend_to_test=backend_fw, - on_device=on_device, - fn_name=fn_name, - input=x[0], - output_size=output_size, - )