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

Support enums #43

Open
alan-cooney opened this issue Jan 27, 2023 · 1 comment
Open

Support enums #43

alan-cooney opened this issue Jan 27, 2023 · 1 comment

Comments

@alan-cooney
Copy link

For larger projects, TensorType[T.BATCH] (where T is an enum) can be better than TensorType["batch"], as it enables standard naming conventions & additional code hints.

It would be great to support this out of the box.

@patrick-kidger
Copy link
Owner

Interesting idea! I agree that'd make sense.

In practice though, TorchTyping is now semi-deprecated in favour of jaxtyping. (Which supports PyTorch too, despite the name.)

It also supports static type checkers etc., doesn't do crazy monkey-patching of typeguard, etc, which is the reason I'm trying to transition people over to it.

In terms of this suggestion: jaxtyping does go all-in on using a string-based DSL. I imagine you could accomplish something similar to this suggestion by simply passing around strings.

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

No branches or pull requests

2 participants