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
Hi, I was wondering if there is a nice way to annotate functions that operate along a given dimension, removing said dimension in the process? Examples for such functions would be sum(), mean(), argmax(), cumsum() etc. I would imagine something along the lines of:
This is a really nice example of something that's both useful, and that we totally don't support at the moment :D
Unfortunately I think adding something like this is pretty hard. I'd be open to taking a PR that does something like this, I think, although the symbolic resolution handling in jaxtyping is fairly finickity. FWIW on syntax I think we'd look for something like Float[Tensor, "{dims[:dim]} {dims[dim+1:]}"], for consistency with how our f-strings already work.
Hi, I was wondering if there is a nice way to annotate functions that operate along a given dimension, removing said dimension in the process? Examples for such functions would be
sum()
,mean()
,argmax()
,cumsum()
etc. I would imagine something along the lines of:where the
*
in the return value denotes unpacking rather than matching an arbitrary number of dimensions.This may be vaguely related to #184 if one could do something like
to provide an at least partially useful hint, even though this wouldn't allow specifying which dimension is removed.
The text was updated successfully, but these errors were encountered: