Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(paddle): Add broadcast_shape function to Paddle Frontend #23574

Merged
merged 20 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/demos
Submodule demos updated from 14156a to 8163e5
8 changes: 8 additions & 0 deletions ivy/functional/frontends/paddle/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ def atanh(x, name=None):
return ivy.atanh(x)


@with_supported_dtypes(
{"2.5.1 and below": ("float32", "float64", "int32", "int64")}, "paddle"
)
@to_ivy_arrays_and_back
def broadcast_shape(x):
maxxies marked this conversation as resolved.
Show resolved Hide resolved
return ivy.broadcast_shapes(*x)


@with_unsupported_dtypes({"2.5.1 and below": ("float16", "bfloat16")}, "paddle")
@to_ivy_arrays_and_back
def ceil(x, name=None):
Expand Down
28 changes: 28 additions & 0 deletions ivy_tests/test_ivy/test_frontends/test_paddle/test_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,34 @@ def test_paddle_atanh(
)


# broadcast_shape
@handle_frontend_test(
fn_tree="paddle.broadcast_shape",
dtype_and_x=helpers.dtype_and_values(
maxxies marked this conversation as resolved.
Show resolved Hide resolved
available_dtypes=helpers.get_dtypes("valid"),
maxxies marked this conversation as resolved.
Show resolved Hide resolved
),
)
def test_paddle_broadcast_shape(
maxxies marked this conversation as resolved.
Show resolved Hide resolved
*,
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],
)


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