What is a shape?
The number of elements in each dimension of a tensor.
shape explained in plain English
The number of elements in each dimension of a tensor. The shape is represented as a list of integers. For example, the following two-dimensional tensor has a shape of [3,4]:
TensorFlow uses row-major (C-style) format to represent the order of dimensions, which is why the shape in TensorFlow is`[3,4]` rather than`[4,3]`. In other words, in a two-dimensional TensorFlow Tensor, the shape is`[` number of rows, number of columns`]`. A static shape is a tensor shape that is known at compile time. A dynamic shape is unknown at compile time and is therefore dependent on runtime data. This tensor might be represented with a placeholder dimension in TensorFlow, as in`[3, ?]`.
Example
Practitioners refer to shape when building, training, or evaluating machine learning systems. It appears in research papers, product documentation, and technical discussions about AI capabilities and limitations.
People also read
- act
A stage in the agentic loop in which the agent executes the action chosen during the reason stage.
- Backpropagation
The process that tells a neural network which internal settings caused an error and how to adjust them, working backwards through layers.
- broadcasting
Expanding the shape of an operand in a matrix math operation to dimensions compatible for that operation.
- Einsum notation
An efficient notation for describing how two tensors are to be combined.
- feature engineering
A process that involves the following steps: 1.
- feedback
A stage in an agentic loop in which the agent evaluates the action taken during the act stage.
- function transformation
A function that takes a function as input and returns a transformed function as output.
- graph
In TensorFlow, a computation specification.
- layer
A set of neurons in a neural network.
- MCP
An open protocol that lets AI models connect to external tools, data sources, and services.