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

Typing for tensor shapes #2402

Open
1 task done
alexander-held opened this issue Dec 18, 2023 · 0 comments
Open
1 task done

Typing for tensor shapes #2402

alexander-held opened this issue Dec 18, 2023 · 0 comments
Labels
feat/enhancement New feature or request needs-triage Needs a maintainer to categorize and assign user request Request coming form a pyhf user

Comments

@alexander-held
Copy link
Member

Summary

Type information that includes tensor shapes could be a powerful way of extended validation (including runtime via typeguard / beartype). The https://github.com/google/jaxtyping project looks rather promising for this. See also https://kidger.site/thoughts/jaxtyping/, specifically:

And note that the name is now historical – it also supports PyTorch/TensorFlow/NumPy, and has no JAX dependency.

There are a few places where I can imagine this to be helpful, e.g. returns from infer that are one-element tensors (where users might expect floats) or predictions from batched models.

Additional Information

n/a

Code of Conduct

  • I agree to follow the Code of Conduct
@alexander-held alexander-held added feat/enhancement New feature or request needs-triage Needs a maintainer to categorize and assign labels Dec 18, 2023
@matthewfeickert matthewfeickert added the user request Request coming form a pyhf user label Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat/enhancement New feature or request needs-triage Needs a maintainer to categorize and assign user request Request coming form a pyhf user
Projects
None yet
Development

No branches or pull requests

2 participants