-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
paddle.numel
tensor instance function
#16614
Conversation
@hmahmood24 please review this PR |
This PR has been labelled as stale because it has been inactive for more than 7 days. If you would like to continue working on this PR, then please add another comment or this PR will be closed in 7 days. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the failing tests and fix them
@handle_frontend_method( | ||
class_tree=CLASS_TREE, | ||
init_tree="paddle.to_tensor", | ||
method_name="numel", | ||
dtype_and_x=helpers.dtype_and_values( | ||
available_dtypes=helpers.get_dtypes("valid"), | ||
min_num_dims=1, | ||
), | ||
) | ||
def test_paddle_numel( | ||
dtype_and_x, | ||
frontend_method_data, | ||
init_flags, | ||
method_flags, | ||
frontend, | ||
on_device, | ||
): | ||
input_dtype, x = dtype_and_x | ||
helpers.test_frontend_method( | ||
init_input_dtypes=input_dtype, | ||
init_all_as_kwargs_np={ | ||
"data": x[0], | ||
}, | ||
method_input_dtypes=input_dtype, | ||
method_all_as_kwargs_np={}, | ||
frontend_method_data=frontend_method_data, | ||
init_flags=init_flags, | ||
method_flags=method_flags, | ||
frontend=frontend, | ||
on_device=on_device, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@handle_frontend_method( | |
class_tree=CLASS_TREE, | |
init_tree="paddle.to_tensor", | |
method_name="numel", | |
dtype_and_x=helpers.dtype_and_values( | |
available_dtypes=helpers.get_dtypes("valid"), | |
min_num_dims=1, | |
), | |
) | |
def test_paddle_numel( | |
dtype_and_x, | |
frontend_method_data, | |
init_flags, | |
method_flags, | |
frontend, | |
on_device, | |
): | |
input_dtype, x = dtype_and_x | |
helpers.test_frontend_method( | |
init_input_dtypes=input_dtype, | |
init_all_as_kwargs_np={ | |
"data": x[0], | |
}, | |
method_input_dtypes=input_dtype, | |
method_all_as_kwargs_np={}, | |
frontend_method_data=frontend_method_data, | |
init_flags=init_flags, | |
method_flags=method_flags, | |
frontend=frontend, | |
on_device=on_device, | |
) | |
@handle_frontend_method( | |
class_tree=CLASS_TREE, | |
init_tree="paddle.to_tensor", | |
method_name="numel", | |
dtype_and_x=helpers.dtype_and_values( | |
available_dtypes=helpers.get_dtypes("valid"), | |
min_num_dims=1, | |
), | |
) | |
def test_paddle_numel( | |
dtype_and_x, | |
frontend_method_data, | |
init_flags, | |
method_flags, | |
backend_fw, | |
frontend, | |
on_device, | |
): | |
input_dtype, x = dtype_and_x | |
helpers.test_frontend_method( | |
init_input_dtypes=input_dtype, | |
init_all_as_kwargs_np={ | |
"data": x[0], | |
}, | |
method_input_dtypes=input_dtype, | |
method_all_as_kwargs_np={}, | |
frontend_method_data=frontend_method_data, | |
backend_to_test=backend_fw, | |
init_flags=init_flags, | |
method_flags=method_flags, | |
frontend=frontend, | |
on_device=on_device, | |
) |
Closes #16613