tensor
A1Pronunciation
UK
- /tˈɛnsə/
US
- /ˈtɛnsər/
Description
- Multi-dimensional quantity
- Generalization of scalars, vectors, and matrices
- Mathematical object
- Data structure for many dimensions
Imagine you're describing the temperature across a room. You could list it for each spot—that's a simple number at each location, like a grid. Now imagine doing that over time, too. Suddenly, you need to track numbers not just by location, but also by moment! That's where tensors come in.
A tensor is a mathematical way to describe values that may depend on several directions or dimensions at once. In many practical settings, you can think of it as numbers arranged in a grid, or even grids within grids. A single number is a 0-dimensional tensor (a scalar). A list of numbers is a 1-dimensional tensor (a vector). A table of numbers is a 2-dimensional tensor (a matrix). Beyond that, you get 3D, 4D, and even higher-dimensional forms.
In physics and engineering, tensors help describe things like stress, strain, and motion in a way that still makes sense if you change direction or point of view. In modern computing, they are also everywhere in data science and machine learning. Images, videos, and audio can all be represented this way. If you've ever used a smartphone camera or interacted with an AI assistant, you've benefited from tensors.
The word "tensor" first became important in physics, where it was used to describe things like stress and strain in materials. Today, it appears in mathematics, physics, engineering, computer science, and especially machine learning. At its core, a tensor is a mathematical object that extends the ideas of scalars (single numbers), vectors (lists of numbers), and matrices (tables of numbers). In many computing contexts, it is treated as data arranged across one or more dimensions.
Think about building up from simple data structures:
Scalar:* A single number like 5. This is a 0-dimensional tensor. Vector:* An ordered list of numbers, like [1, 2, 3]. This is a 1-dimensional tensor. It can represent things like velocity or direction. Matrix:* A rectangular grid of numbers, like [[1, 2], [3, 4]]. This is a 2-dimensional tensor. It's useful for representing transformations and relationships between data points. Tensor (3D+):* Now imagine stacking multiple matrices on top of each other—that's a 3-dimensional tensor. You can keep adding dimensions. A 4D tensor might represent a video (height, width, color channels, and time).
In everyday computing, people often talk about the "number of dimensions" of a tensor. A scalar has 0, a vector has 1, a matrix has 2, and so on. The "shape" of a tensor describes the size along each dimension, so a 3x4 matrix has the shape (3, 4).
In mathematics and physics, a tensor is more than just a stack of numbers. It describes quantities that follow clear rules when you change coordinates. That is why tensors are useful for expressing ideas such as force relationships, curvature, stress, and strain. This broader meaning is the reason the word has such a strong place in science.
In machine learning, tensors are used to represent many kinds of data: images as arrays of pixel values, text as sequences of numeric representations, and audio as sampled signals. Neural networks perform calculations on these tensors using operations like addition, multiplication, and convolution. Libraries like TensorFlow and PyTorch are built around this idea, making it possible to process large amounts of structured data efficiently.
So, while the term may sound intimidating, the basic idea is not mysterious. In science, it names a quantity that can capture relationships across directions and coordinates. In computing, it often means a structured collection of numbers spread across many dimensions. Both meanings are closely connected, and together they explain why tensors matter in so many fields.
Examples
- 1
Model input
The library expects the input as a tensor, not a plain Python list.
Domain
in computing, a tensor is a set of numbers arranged in one or more dimensions
- 2
Image processing
The program converts each image into a tensor before sending it to the model.
- 3
Physics
In physics, the stress tensor describes how forces act inside the material.
Forms and spellings
2 forms open this card.
Main spelling
- tensornoun
Forms
- tensorspluralnoun