Skip to content

jax.nn.initializers: use Sequence[int] directly for shape annotations. #27202

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

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

Conversation

jakevdp
Copy link
Collaborator

@jakevdp jakevdp commented Mar 17, 2025

Why? Since this is a public protocol, we shouldn't use internal-only types like core.Shape. Rather than exposing core.Shape (which still uses Any to support experimental APIs) we should make this more directly user-definable.

Fixes #27200.

@jakevdp jakevdp requested a review from ZacCranko March 17, 2025 21:49
@jakevdp jakevdp self-assigned this Mar 17, 2025
@jakevdp jakevdp added the pull ready Ready for copybara import and testing label Mar 17, 2025
Copy link
Collaborator

@ZacCranko ZacCranko left a comment

Choose a reason for hiding this comment

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

Works for me!

Why? Since this is a public protocol, we shouldn't use internal-only types like core.Shape.
Rather than exposing core.Shape (which still uses Any to support experimental APIs) we should
make this more directly user-definable.
@jakevdp jakevdp force-pushed the initializers-types branch from d80282a to 4cf10b7 Compare March 26, 2025 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kokoro:force-run pull ready Ready for copybara import and testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export jax._src.typing.Shape to jax.typing.
2 participants