jaxtyping icon indicating copy to clipboard operation
jaxtyping copied to clipboard

Are pytorch named tensors supported, like in torchtyping?

Open zxti opened this issue 1 year ago • 2 comments

zxti avatar Apr 15 '24 04:04 zxti

I'm afraid there is no special support for these. I don't really recommend using them -- PyTorch itself seems to have mostly given up on adding further support for them. So they're only supported on a small number of PyTorch operations anyway.

patrick-kidger avatar Apr 15 '24 07:04 patrick-kidger

That means you cannot access the dimension names, right? For example, I would like to apply something across all dimensions named L. Thanks!

@dataclass
class Label:
    coordinates: Float32[Tensor, "L 3"]
    distances: Float32[Tensor, "L L"]

lhatsk avatar Sep 02 '24 16:09 lhatsk