Repository navigation
Conversation
stroxler
requested changes
Nov 16, 2026
stroxler
left a comment
Contributor
There was a problem hiding this comment.
Could you rebase?
Auto-import of PRs got paused when we renamed the repo to pyrefly-org/pyrefly. It seems to be running again, I think a rebase should trigger and import diff. Other than that this LGTM
QEDady
force-pushed
the
jax-stubs-binary-ufunc
branch
from
November 16, 2026 21:50
63f3b64 to
0719bea
Compare
Contributor
|
This pull request has been imported. If you are a Meta employee, you can view this in D132380863. (Because this pull request was imported automatically, there will not be any future comments.) |
Collaborator
Author
|
Rebased. Seems the bot picked it up. Thank you! |
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
In
jax.numpy, binary universal functions (add,subtract,multiply,maximum,minimum,logaddexp,logaddexp2,bitwise_and,bitwise_or,bitwise_xor,logical_and,logical_or, andlogical_xor) are runtimejnp.ufuncinstances rather than plain functions, and stockjax/numpy/__init__.pyitypes them with aBinaryUfuncprotocol exposing.reduce,.accumulate,.at,.reduceat, and.outer. Previously, these were declared withdef, so accessing ufunc methods likejnp.maximum.accumulateorjnp.add.reducefailed withObject of class FunctionType has no attribute ...:This PR adds the
BinaryUfuncprotocol to with shape-preserving/shape-transforming signatures for__call__,reduce,accumulate,at,reduceat, andouter, updatesclass ufuncto includeatand matchreduce/reduceatparameters, and types the binary ufuncs asBinaryUfunc.Test Plan
Added unit tests.