-
Notifications
You must be signed in to change notification settings - Fork 2.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
DOC: Improve docs for jnp.trim_zeros
#23540
Conversation
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.
Thanks!
Looks like the new type annotations led to some mypy failures. I'd remove the type annotations from this doc PR, and add them back in another PR if you're interested in doing that work. |
Thanks! I would remove the annotation in this PR and open another PR for that. Also, >>> jnp.trim_zeros([0, 2, 3, 1, 0, 0])
Array([2, 3, 1], dtype=int32) Since JAX APIs doesn't take python lists as input, can we make this compatible with other APIs by introducing an array check using |
6af8cd1
to
c5bc241
Compare
Yeah, good catch! We should definitely restrict this to arraylike inputs, but that will require a deprecation cycle (you can see similar things in process for other functions in this file) |
Thanks @jakevdp. I will do that. |
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.
Thanks! I'll look for your PRs with the followup fixes to annotations and checking arraylike inputs.
Part of #21461
Rendered output: