A tensor is a collection of numbers. If you have a single number the tensor has rank 0. If you have a list or array or vector of numbers the tensor has rank 1. If you have a matrix (2D) array you have a tensor of rank 2. So a tensor can be thought of as a multidimensional array of numbers. The way tensors relate to ML is that lots of ML algorithms involve multiplying tensors. If I have a batch of RGB images as inputs, each is a tensor of rank 3 – height x width x depth 3 for each color channel. But the batch is a tensor of rank 4 because there are k images of rank 3. The tensor now has an index that specifies which image in the batch is being considered.
Latest Answers