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

Rename _wraps to implements #19507

Merged
merged 1 commit into from
Jan 25, 2024
Merged

Conversation

jakevdp
Copy link
Collaborator

@jakevdp jakevdp commented Jan 24, 2024

I've been wanting to change this for a while, because "wraps" is really a misnomer here: wraps implies that the decorated function somehow calls out to the wrapped function, but that is not the case for JAX implementations of NumPy functions. I think implements is more accurate for this case.

Also remove the leading underscore: it's misleading because we expect this function to be used outside the module that defines it (it's still defined in jax._src, however, so it's not a public API).

@jakevdp jakevdp requested a review from mattjj January 24, 2024 22:16
@jakevdp jakevdp self-assigned this Jan 24, 2024
Copy link
Collaborator

@mattjj mattjj left a comment

Choose a reason for hiding this comment

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

Thank you!

@google-ml-butler google-ml-butler bot added kokoro:force-run pull ready Ready for copybara import and testing labels Jan 25, 2024
@copybara-service copybara-service bot merged commit 45daced into jax-ml:main Jan 25, 2024
13 checks passed
@jakevdp jakevdp deleted the wraps-implements branch January 25, 2024 19:20
@jecampagne
Copy link
Contributor

Hi, does this @implement decorator would be in a future put outside _src with an API description, or would remain a sort of "private" deco? I ask as we use this deco for docstring description of functions that are our JAX implementation of a library.

@jakevdp
Copy link
Collaborator Author

jakevdp commented Jun 5, 2024

No, I don't think we'll ever make @implements a public API. JAX is an accelerated linear algebra library, not a library of decorators to help generate docstrings.

I ask as we use this deco for docstring description of functions that are our JAX implementation of a library.

As with all JAX's internal APIs, I would not recommend using it outside JAX internal code, as it may be changed or removed in future releases without warning. In fact we're actively moving away from using @implements even internally (see #21461), and my goal would be to remove it entirely in the near future.

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.

4 participants