I get this with Python3.6, Pytorch 1.0.1.post2 on a linux.
Here’s the line of code raising this:
val_batch_output[idx,:,:,:].copy_(x_hat_val.data)
RuntimeError: expand(torch.cuda.FloatTensor{[1, 3, 256, 256]}, size=[3, 256, 256]): the number of sizes provided (3) must be greater or equal to the number of dimensions in the tensor (4)