tensor.reshape copies the data under the hood, if needed for the view operation (which would otherwise yield an error explaining your data is not contiguous in memory and you thus cannot change its strides and shapes since it would overlap). It’s not a replacement for permute, but for .contiguous().view().