What are tensors?

In data science, tensors are a type of data structure used in linear algebra to describe a multilinear relationship between sets of algebraic objects within a vector space.

Tensors generalize scalars, vectors, and matrices to higher dimensions.

If a scalar is a point, you add a dimension and get a vector (line with direction), you add another dimension and get a matrix (grid of values), stack those together and you get a 3D tensor.

A single-dimensional tensor can be represented as a vector, while a two-dimensional tensor is represented as a matrix.

Colour images are technically 3D tensors, containing a grid of R, G, and B values (and sometimes a fourth alpha channel).