I have the following code and the last line is giving me that error. Is there a way I can do indexing copy like numpy?
N, C, H, W = features.size()
gram = torch.zeros((N, C, C))
print(gram.size())
for i in range(N):
f = features[i, :, :, :]
print(f.size())
f = f.view(C, -1)
print(f.size())
g = torch.mm(f, f.t())
print(g.size())
gram[i, :, :] = g
Since PyTorch 0.1.12 (if I am not wrong), they have included a torch.__version__ attribute that helps you find out which version of PyTorch you are using.
Run torch.__version__ on a Python interpreter after importing PyTorch to find out.