jaxtyping icon indicating copy to clipboard operation
jaxtyping copied to clipboard

invalid-type-form when using ty

Open alirezanobakht13 opened this issue 5 months ago • 2 comments

I'm using ty as my language server and I get the following error for Key (from jaxtyping import Key):

`typing.Annotated` requires at least two arguments when used in a type expression ty([invalid-type-form](https://ty.dev/rules#invalid-type-form))

is it necessary to annotate key with array? like Key[Array, "s1 s2"]?

alirezanobakht13 avatar Aug 03 '25 07:08 alirezanobakht13

Yup, it is. Key works as a dtype, just like jaxtyping.Float etc. This is essentially the way that JAX represents these internally as well.

patrick-kidger avatar Aug 03 '25 08:08 patrick-kidger

got it. thanks.

alirezanobakht13 avatar Aug 03 '25 08:08 alirezanobakht13