Machine Learning

Tensor

A multi-dimensional array of numbers — the fundamental data structure in deep learning. Scalars are 0D tensors, vectors are 1D, matrices are 2D, and higher-dimensional arrays are nD tensors.

Why It Matters

Tensors are the building blocks of neural network computation. Every input, weight, and output in a model is represented as a tensor.

Example

An image represented as a 3D tensor with dimensions [height=224, width=224, channels=3 (RGB)], or a batch of 32 such images as a 4D tensor [32, 224, 224, 3].

Think of it like...

Like a spreadsheet that can have more than 2 dimensions — a regular spreadsheet is 2D (rows and columns), but tensors can extend into 3D, 4D, and beyond.

Related Terms