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

DOC: Better doc for jnp.rot90 #23451

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

rajasekharporeddy
Copy link
Contributor

@rajasekharporeddy rajasekharporeddy commented Sep 5, 2024

An array containing the elements of ``m`` rotated by 90 degrees.

Note:
- Unlike :func:`numpy.rot90`, :func:`jax.numpy.rot90` will return a copy rather
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to say this here – it's true of every JAX API.

The reason we included this text in lax_description previously was that the numpy docs explicitly mention that the output is a view rather than a copy,. Now that we're not using NumPy's docs, we don't need text that corrects them.

If you're worried about this, you could mention under Returns: that the result is a copy of the input

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I have seen a similar note in APIs like jnp.transpose and jnp.matrix_transpose in the updated docs. So, I have included the note for this API also. Can we remove the note in those APIs also?

jax/_src/numpy/lax_numpy.py Outdated Show resolved Hide resolved
jax/_src/numpy/lax_numpy.py Outdated Show resolved Hide resolved
@jakevdp jakevdp self-assigned this Sep 5, 2024
Copy link
Collaborator

@jakevdp jakevdp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Can you squash the changes into one commit? Thanks!

@rajasekharporeddy
Copy link
Contributor Author

Thanks! Squashed into single commit.

@google-ml-butler google-ml-butler bot added kokoro:force-run pull ready Ready for copybara import and testing labels Sep 5, 2024
@copybara-service copybara-service bot merged commit 2904180 into jax-ml:main Sep 5, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pull ready Ready for copybara import and testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants