Autocompletion in Pycharm

I’m using PyCharm as default IDE which is very powerful for several reasons.

Autocompletion of torch functions doesn’t work in several scenery such as using functions directly imported in torch module. Even though, when executed, it works perfectly.

Scenery 1

# It doesn't recognize functions like `cat`
torch.cat([a, b])

Scenery 2

class MyModel(nn.Module):
  def __init__(self):
    super(MyModel).__init__()

  def forward(self, *input):
    # Do something awesome

model = MyModel()

 # Functional calling is not recognized and its really helpful
model(x)

Hi, this is probably related to https://github.com/pytorch/pytorch/issues/7318, apparently a PR is coming, though I don’t know its extent.

1 Like

Also check out V0.4 - PyCharm "unknown" inspections: `unexpected argument`, `not callable`, etc