torchtyping icon indicating copy to clipboard operation
torchtyping copied to clipboard

Dimension size as expression of another dimension

Open ikamensh opened this issue 2 years ago • 1 comments

Hi,

I'm new to using torchtyping, and my usecase is the following: I have a data structure that has tensor of size N and another one of size N - 1. Is there a way to specify this? Naive attempt of using TensorType["time" - 1] failed.

Thanks!

ikamensh avatar Jul 28 '21 17:07 ikamensh

Currently the best way to specify this is just TensorType["time - 1"]. This will just define another dimension name though. So it's good for documentation purposes but won't be able to check that "time" - 1 = "time" - 1, so to speak.

Having this work is something I'd like to add; see issue #2. It should be possible to make work at a technical level; I just haven't found the time to implement it.

patrick-kidger avatar Jul 28 '21 20:07 patrick-kidger