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): Added is_empty method to Paddle Frontend #26074

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions ivy/functional/frontends/paddle/tensor/tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,9 @@ def rot90(self, k=1, axes=(0, 1), name=None):
def imag(self, name=None):
return paddle_frontend.imag(self)

def is_empty(self):
return paddle_frontend.is_empty(self)

def is_tensor(self):
return paddle_frontend.is_tensor(self)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2521,6 +2521,37 @@ def test_paddle_tensor_inner(
)


# is_empty
@handle_frontend_method(
class_tree=CLASS_TREE,
init_tree="paddle.to_tensor",
method_name="is_empty",
dtype_and_x=helpers.dtype_and_values(
available_dtypes=helpers.get_dtypes("float"),
num_arrays=1,
),
)
def test_paddle_tensor_is_empty(
dtype_and_x,
frontend_method_data,
init_flags,
method_flags,
frontend,
on_device,
backend_fw,
):
input_dtype, x = dtype_and_x
print("x", x)
print("input_dtype", input_dtype)
# TODO: Fix AttributeError
# ivy.functional.backends.numpy
# ivy.functional.backends.jax
# ivy.functional.backends.tensorflow
# ivy.functional.backends.torch
# ivy.functional.backends.paddle
# has no attribute 'is_empty'


# is_tensor
@handle_frontend_method(
class_tree=CLASS_TREE,
Expand Down
Loading