Skip to content

Commit

Permalink
feat: add paddle tolist (ivy-llc#26606)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anteemony authored and druvdub committed Oct 14, 2023
1 parent 1395290 commit 1075eac
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ivy/functional/frontends/paddle/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@ def tile(x, repeat_times, name=None):
return ivy.tile(x, repeats=repeat_times)


@to_ivy_arrays_and_back
def tolist(x):
return ivy.to_list(x)


@with_supported_dtypes(
{"2.5.1 and below": ("bool", "int32", "int64", "float16", "float32", "float64")},
"paddle",
Expand Down
26 changes: 26 additions & 0 deletions ivy_tests/test_ivy/test_frontends/test_paddle/test_manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,32 @@ def test_paddle_tile(
)


@handle_frontend_test(
fn_tree="paddle.tolist",
dtype_and_x=helpers.dtype_and_values(available_dtypes=helpers.get_dtypes("valid")),
test_with_out=st.just(False),
)
def test_paddle_tolist(
*,
dtype_and_x,
on_device,
fn_tree,
backend_fw,
frontend,
test_flags,
):
x_dtype, x = dtype_and_x
helpers.test_frontend_function(
input_dtypes=x_dtype,
backend_to_test=backend_fw,
frontend=frontend,
test_flags=test_flags,
fn_tree=fn_tree,
on_device=on_device,
x=x[0],
)


# unbind
@handle_frontend_test(
fn_tree="paddle.unbind",
Expand Down

0 comments on commit 1075eac

Please sign in to comment.