torch.Tensor.view
Tensor.view(*shape) -> Tensor
Returns a new tensor with the same data as the "self" tensor but of
   a different "shape".
The returned tensor shares the same data and must have the same
   number of elements, but may have a different size. For a tensor to
   be viewed, the new view size must be compatible with its original
   size and stride, i.e., each new view dimension must either be a
   subspace of an original dimension, or only span across original
   dimensions d, d+1, \dots, d+k that satisfy the following
   contiguity-like condition that \forall i = d, \dots, d+k-1,
  \text{stride}[i] = \text{stride}[i+1] \times \text{size}[i+1]

Otherwise, it will not be possible to view "self" tensor as "shape"
   without copying it (e.g., via "contiguous()"). When it is unclear
   whether a "view()" can be performed, it is advisable to use
   "reshape()", which returns a view if the shapes are compatible, and