Hi all,
A few of us have been working on the draft of PEP 646, enabling support for variadic generics in Python. This is relevant to PyTorch because the primary use case is to support array types that are generic in their shapes, e.g. Tensor[Batch, Height, Width]. (For a more detailed example of how this might work, see our experimental tensor_annotations 9 library. We currently only support TensorFlow and JAX, but we’d love to support PyTorch in the future too.)
Before setting the PEP in stone, we’d like to get some feedback from folks working on libraries like PyTorch to reduce the chances of making design decisions that are going to bite us later on. If you’re interested, please leave some comments on the current draft in this doc 9.
Thanks!
Matthew