What a Tensor Is
Tensors: The Building Blocks
Tensor meaning
A tensor is a general way to represent data as numbers arranged in one or more dimensions. A scalar is a single number, a vector is a 1D list of numbers, and a matrix is a 2D grid of numbers.
Why tensors matter
Machine learning systems need a standard way to handle data like images, sound, tables, and text features. Tensors provide that structure, and TensorFlow is designed to work with them efficiently.
Tensor shapes
| Data type | Example shape | Meaning |
|---|---|---|
| Scalar | One number | |
| Vector | Three values in a row | |
| Matrix | Two rows and three columns | |
| Image batch | 32 grayscale images of size 28 by 28 |
Shape Matters
The shape of a tensor tells you how the data is organized, which is crucial when building models.
Which best describes a tensor?
Tensors are multi-dimensional numeric arrays.
Correct answer: A numerical data structure with one or more dimensions
What do we call a 2D tensor?
A matrix is a tensor with rows and columns.
Correct answer: Matrix
Why is tensor shape important?
Models need correctly shaped inputs to work properly.
Correct answer: It tells the computer the data structure