Tensor
A multidimensional array of numbers — the main currency of neural networks. All the data going into and coming out of a model is represented as tensors.
Dimensions
| Tensor | Dimensionality | Example |
|---|---|---|
| Scalar | 0D | 5 |
| Vector | 1D | [0.2, 0.8, 0.1] |
| Matrix | 2D | A table of numbers |
| Tensor | 3D+ | A matrix of matrices |
Shape
The key property of a tensor is its shape. For example, a batch of 32 images of 224×224 with three colour channels has the shape (32, 3, 224, 224).
Where They Are Used
- the inputs and outputs of network layers;
- weights — also tensors;
- computations on a GPU: graphics cards multiply tensors in parallel extremely well.