Glossary term
Glossary term
Foundations
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]:
[[5, 7, 6, 4],
[2, 9, 4, 8],
[3, 6, 5, 1]]
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, ?].
Created for this library
An ML engineer inspects tensor shape during debugging to confirm batch and feature dimensions match expectations.
A research engineer logs tensor shapes at each layer to identify shape mismatches early during model development.
An ML platform team adds tensor shape assertions in its production graph to fail loudly on shape errors during model loading.
Definition source: Google for Developers Machine Learning Glossary | Creative Commons Attribution 4.0 License