Import torch.nn.functional as F ModuleNotFoundError: No module named 'torch.nn'

Hi.

Keep getting this error despite installing pytorch as instructed:

—> 10 import torch.nn.functional as F
11 from torch import nn, einsum
12 import torchvision.transforms as T

ModuleNotFoundError: No module named ‘torch.nn’

What does import torch and print(torch.__path__) return? Also, is your wdir set to the PyTorch install directory?
Could you also check if you’ve created local files with conflicting names, such as torch.py?