.reshape returns a view of the tensor it possible and a copy if necessary (docs).
Some operations need contiguous tensors to use e.g. the strides of the tensor internally.
If your tensor is non-contiguous, you’ll get an error, to avoid wrong computations and other side effects.