patrick-kidger / torchtyping

Type annotations and dynamic checking for a tensor's shape, dtype, names, etc.
Apache License 2.0
1.41k stars 34 forks source link

The loss of declaration track in Pycharm #18

Closed iamlxb3 closed 3 years ago

iamlxb3 commented 3 years ago

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

image

The track is lost when set to TensorType in torchtyping

image

There is one workaround though, by using Union in typing to include them both. But I think it a bit ugly.

patrick-kidger commented 3 years ago

Thanks for the report. This should now be fixed in the latest version, 0.1.3.