Skip to content

Commit

Permalink
🤖 Lint code
Browse files Browse the repository at this point in the history
  • Loading branch information
ivy-branch committed Oct 24, 2023
1 parent 2d13763 commit 4684c21
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 38 deletions.
1 change: 1 addition & 0 deletions ivy/data_classes/array/experimental/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions ivy/data_classes/container/experimental/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ivy/functional/ivy/experimental/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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,
)

0 comments on commit 4684c21

Please sign in to comment.