You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm curious why the API for array annotations is Float[Array, "dims"] and not Array[float, "dims"]? The latter would make it consistent with PyTree[float].
The text was updated successfully, but these errors were encountered:
So from a static type-checking point of view, we'd like both Array and Array[...] to mean jnp.ndarray.
We could accomplish the former by just setting Array = jnp.ndarray, but then the latter would break ([...] isn't valid: you can't write jnp.ndarray[...].
The fix is to do what we do here. As far as the static type checker is concerned, Float = typing.Annotated, and thus Float[Array, ...] = Array = jnp.ndarray, and things work out.
Hi!
I'm curious why the API for array annotations is
Float[Array, "dims"
] and notArray[float, "dims"]
? The latter would make it consistent withPyTree[float]
.The text was updated successfully, but these errors were encountered: