When I use 'torch.tensor()' in pycharm,it has some issue?

when I use ‘torch.tensor()’ in pycharm ,it has the ‘tensor is not callabel’ issue,but the program is normal to run.Anyone can tell me this is why?Thanks!

maybe an old PyTorch version? Can you check what PyTorch version your PyCharm env is importing/using?

the version is 0.4.1

The version is 0.4.1.It shouldn’t have happened by reason.

and the same code works fine if you run it w/o PyCharm?

yes,it works fine if I run it.So I want to know this is why?

Hm, it’s probably due to the fact that PyCharm is doing some stuff in their backend to infer the type, which can be the cause of this problem then. E.g., there’s a GitHub issue about that:

Thank you very much!In Pycharm,it only torch.Tensor,but not has torch.tensor.I will see it.Thanks your reply!