I think your x_hat_val data is of shape (1, 3, 256, 256) whereas val_batch_output requires data of shape (3, 256, 256). Try removing the first 1 dim from the data.
val_batch_output[idx,:,:,:].copy_(x_hat_val.data.squeeze())