-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Add tolist method to JAX Array and TensorFlow EagerTensor frontends #28917
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
Merged
Sam-Armstrong
merged 5 commits into
ivy-llc:main
from
kallal79:feature/implement-tolist-frontend-methods
Jul 21, 2025
+90
−0
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6e3580a
feat: implement tolist method for JAX Array and TensorFlow EagerTenso…
kallal79 e20a66d
docs: add test status notes clarifying unrelated test failure
kallal79 260e3c7
Merge branch 'main' into feature/implement-tolist-frontend-methods
kallal79 7f7d2ba
fix: address reviewer feedback for tolist implementation
kallal79 56642ab
Merge branch 'feature/implement-tolist-frontend-methods' of https://g…
kallal79 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1607,3 +1607,45 @@ def test_tensorflow_shape( | |||||||||
| x.ivy_array.shape, ivy.Shape(shape), as_array=False | ||||||||||
| ) | ||||||||||
| ivy.previous_backend() | ||||||||||
|
|
||||||||||
|
|
||||||||||
| # tolist | ||||||||||
| @handle_frontend_method( | ||||||||||
| class_tree=CLASS_TREE, | ||||||||||
| init_tree="tensorflow.constant", | ||||||||||
| method_name="tolist", | ||||||||||
| dtype_and_x=helpers.dtype_and_values( | ||||||||||
| available_dtypes=helpers.get_dtypes("valid"), | ||||||||||
| min_num_dims=0, | ||||||||||
| max_num_dims=5, | ||||||||||
| min_dim_size=1, | ||||||||||
| max_dim_size=10, | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
same here
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed docstrings from frontend methods - Now follows Ivy's convention for clean, minimal frontend implementations |
||||||||||
| min_value=-1e05, | ||||||||||
| max_value=1e05, | ||||||||||
| ), | ||||||||||
| ) | ||||||||||
| def test_tensorflow_tensor_tolist( | ||||||||||
| dtype_and_x, | ||||||||||
| frontend_method_data, | ||||||||||
| init_flags, | ||||||||||
| method_flags, | ||||||||||
| frontend, | ||||||||||
| on_device, | ||||||||||
| backend_fw, | ||||||||||
| ): | ||||||||||
| input_dtypes, x = dtype_and_x | ||||||||||
| helpers.test_frontend_method( | ||||||||||
| init_input_dtypes=input_dtypes, | ||||||||||
| backend_to_test=backend_fw, | ||||||||||
| init_all_as_kwargs_np={ | ||||||||||
| "value": x[0], | ||||||||||
| }, | ||||||||||
| method_input_dtypes=input_dtypes, | ||||||||||
| 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, | ||||||||||
| test_values=False, # tolist returns Python list, not array | ||||||||||
| ) | ||||||||||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We need to add this so the values don't overflow and fail the test when running with a high number of examples (
--num-examples 100)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.
Removed TEST_STATUS_NOTES.md file - Eliminated unnecessary documentation clutter