The typing check is really useful, however, I found it a bit inconvenient to jump right into the source code of torch with Pycharm. It seems the declaration track is lost. Below I give two quick examples.
Everything is ok if the typing is set to torch.Tensor
The track is lost when set to TensorType in torchtyping
There is one workaround though, by using Union in typing to include them both. But I think it a bit ugly.
The typing check is really useful, however, I found it a bit inconvenient to jump right into the source code of torch with Pycharm. It seems the declaration track is lost. Below I give two quick examples.
Everything is ok if the typing is set to torch.Tensor
The track is lost when set to TensorType in torchtyping
There is one workaround though, by using Union in typing to include them both. But I think it a bit ugly.