Add TorchTyping? #71
Labels
documentation
Improvements or additions to documentation
enhancement
New feature or request
good first issue
Good for newcomers
low priority
Should be fixed eventually, but isn't urgent
Recently I attended the PyTorch Developer event and one of the posters advertised the torchtyping package which can be used to better type-hint tensors in the code, by showing the expected dimensions with string descriptions, e.g.:
The dimensions of tensors can also be checked at runtime.
This is potentially useful for both developers & power-users, due to more detailed type-hinting and better diagnostics when using custom modules.
However, it is not compatible with MyPy static type-checking, meaning that
TensorType
must be treated asAny
:Whilst not essential, replacing the
Tensor
type-hints in the codebase withTensorType
could be useful.The text was updated successfully, but these errors were encountered: