@ecolss Wouldn’t data.view be more appropriate than data.resize in this case? The output tensor has the same size, just a different shape. I think PyTorch’s view is very similar to numpy’s reshape method.