Pytorch tensor is a multi-dimensional array, where all the items in it have the same type.

They’re similar to NumPy arrays, but they can be stored on GPUs and use them to do operations.

  • The rank of a tensor is how many dimensions it has.
    • you can get it by getting the len of tensor.shape
  • The shape of a tensor is the size of each dimension

https://pytorch.org/docs/stable/tensors.html

mlai