In numpy, dimensions of a tensor is called the axis.
- Tensors are equivalent to lists of lists.
- The higher the axis, the more “inner” list we are talking about.
- Each axis’s value determines the number or elements that array has
- A tensor of shape (=dimension)
(a,b,c)
hasa
rows (axis 0),b
columns (axis 1), andc
of axis 2.- For example, a tensor with shape
(10,2,20)
- For example, a tensor with shape
Tensor Multiplication
When matrix A
with shape (a1,a2)
is multiplied by tensor B
of shape (b1,b2)
:
a2
must be equal tob1
- resulting matrix will have shape
(a1,b2)
. (in Linear Algebra terms, it is a composite linear transformation of both and ). When you have multiple matrix multiplications you can combine that into one.