Each of these methods returns a Tensor which is another way of viewing the Storage of the given tensor. Hence, any modification in the memory of the sub-tensor will have an impact on the primary tensor, and vice-versa.

These methods are very fast, are they do not involve any memory copy.

Subsections

  1. [Tensor] transpose(dim1, dim2)
  2. [Tensor] t()
  3. [Tensor] unfold(dim, size, step)