Rank Shape Size Of Tensors

less than 1 minute read

Rank

  • The rank of a tensor refers to the number of dimensions present within the tensor.
  • A tensor’s rank tells us how many indexes are needed to refer to a specific element within the tensor.

Axis of tensor

  • An axis of a tensor is a specific dimension of a tensor.
  • If we say that a tensor is a rank 2 tensor, we mean that the tensor has 2 dimensions, or equivalently, the tensor has two axes.

Length of axis

  • The length of each axis tells us how many indexes are available along each axis.

Shape Of A Tensor

  • The shape of a tensor gives us the length of each axis of the tensor.

Reshape tensor

  • Changes the number of elements in each axis
  • Reshaping changes the shape but not the underlying data elements.

Updated: