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

Add type annotation for zero_from_primal #26346

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

Conversation

NeilGirdhar
Copy link
Contributor

@NeilGirdhar NeilGirdhar commented Feb 6, 2025

Would be nice to also change the signature to:

def zero_from_primal(val: T, /, *, symbolic_zeros: bool = False) -> T:

Generally, Boolean parameters should be keyword-only arguments since passing a Boolean value is inscrutable. And val should probably be positional-only since its name is unuseful.

I believe this function can transform jax.Array to np.NDArray[jax.numpy.float0], but I believe that the latter array is for all intents and purposes a jax.Array as discussed in various issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant