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

Make jnp.negative a ufunc & add unary ufunc tests #23744

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jakevdp
Copy link
Collaborator

@jakevdp jakevdp commented Sep 18, 2024

No description provided.

@jakevdp jakevdp self-assigned this Sep 18, 2024
@@ -909,15 +909,15 @@ def max(self, values, *, indices_are_sorted=False, unique_indices=False,
"setitem": _unimplemented_setitem,
"copy": _copy,
"deepcopy": _deepcopy,
"neg": ufuncs.negative,
"pos": ufuncs.positive,
"neg": lambda self: ufuncs.negative(self),
Copy link
Collaborator Author

@jakevdp jakevdp Sep 18, 2024

Choose a reason for hiding this comment

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

These need an extra wrapper because when a class attribute is set to a class instance, Python assumes it's a descriptor, but we want it to be a method.

@jakevdp jakevdp added the pull ready Ready for copybara import and testing label Sep 21, 2024
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.

2 participants