A tensor is a mathematical object that can be thought of as a multi-dimensional array of numbers, which can be used to describe linear relationships between sets of vectors, scalars, and other tensors. Tensors can be classified into different types based on their rank, which is the number of indices required to describe them. Scalars are tensors of rank 0, vectors are tensors of rank 1, and matrices are tensors of rank 2.