lemniscate.pytorch
lemniscate.pytorch copied to clipboard
RuntimeError: set_sizes_contiguous is not allowed on Tensor created from .data or .detach(), in Pytorch 1.1.0
My pytorch is 1.1.0. x.data.resize(batchSize, inputSize, 1)_ in NCEAverage.py doesn't work. with torch.no_grad(): x.resize(batchSize, inputSize, 1)_ still doesn't work. I replaced it as _ x.unsqueeze(2))_ . I wonder if this function works the same as x.data.resize(batchSize, inputSize, 1)_
Hi, there. Have you solved the compatibility of Pytorch?
Use torch.reshape
out = torch.bmm(weight, torch.reshape(x, (batchSize, inputSize, 1)))
It seems that robert's suggestions can work, but gradOutput.data.resize_(batchSize, 1, K+1) in around line 60 should be changed to gradOutput.resize_(batchSize, 1, K + 1).