Skip to content

Commit

Permalink
Revert "fold_function"
Browse files Browse the repository at this point in the history
This reverts commit 524d93b.
  • Loading branch information
teckno committed Sep 30, 2023
1 parent 524d93b commit fc79385
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ivy/functional/frontends/paddle/nn/functional/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,7 @@ def linear(x, weight, bias=None, name=None):
@with_supported_dtypes({"2.5.1 and below": ("float32", "float64")}, "paddle")
def alpha_dropout( x, p=0.5, training=True, name=None ):
return ivy.alpha_dropout(x, p=p, training=training)
@to_ivy_arrays_and_back
@with_supported_dtypes({"2.5.1 and below": ("float32", "float64")}, "paddle")
def fold( x, output_sizes, kernel_sizes, strides=1, paddings=0, dilations=1, name=None ):
return ivy.fold(x, output_sizes, kernel_sizes, strides, paddings, dilations)
Original file line number Diff line number Diff line change
Expand Up @@ -464,3 +464,51 @@ def test_paddle_alpha_dropout(
axis=axis,
mode=mode,
)

#fold
@handle_frontend_test(
fn_tree="paddle.nn.functional.common.fold",
d_type_and_x=helpers.dtype_and_values(
available_dtypes=helpers.get_dtypes("float"),
num_arrays=1,
shared_dtype=True,
min_value=2,
max_value=5,
min_num_dims=1,
max_num_dims=1,
min_dim_size=2,
),
p=st.floats(min_value=0.0, max_value=1.0),
axis=st.integers(min_value=0, max_value=1),
training=st.booleans(),
mode=st.one_of(
*[st.just(seq) for seq in ["upscale_in_train", "downscale_in_infer"]]
),
)
def test_paddle_fold(
*,
d_type_and_x,
p,
on_device,
fn_tree,
backend_fw,
frontend,
test_flags,
training,
axis,
mode,
):
dtype, x = d_type_and_x
helpers.test_frontend_function(
input_dtypes=dtype,
p=p,
frontend=frontend,
backend_to_test=backend_fw,
fn_tree=fn_tree,
test_flags=test_flags,
on_device=on_device,
x=x[0],
training=training,
axis=axis,
mode=mode,
)

0 comments on commit fc79385

Please sign in to comment.