7.2.2 Tensor Component Array Area
The Tensor Component Array Area organizes tensor components in multi-dimensional arrays, enabling algebraic operations and geometric insights.
Tensor Component Array Area is the area of study concerned with how a tensor's components are laid out as a concrete multidimensional array in memory or on paper — the shape tuple describing axis lengths, the strides describing how far apart consecutive elements of each axis sit, and the linearization scheme (row-major or column-major) that maps a multi-index down to a single position in a one-dimensional storage sequence. Where the structure area asks what patterns of relationship hold among component values, the array area asks how those values are physically arranged and accessed, a question that matters primarily for computation rather than for the tensor's intrinsic mathematical content.
Shape, Strides, and Linearization
Shape as the Starting Point
The shape tuple (d₁, ..., d_n) fixes how many values each axis of the array holds and, via the component count relation, how many total scalar entries the array contains; the array area takes this shape as given and asks how those entries are actually arranged in a linear sequence of memory addresses.
Strides Encode the Arrangement
A stride for a given axis is the number of storage positions one must advance to move one step along that axis while holding all other indices fixed. For an array with shape (d₁, ..., d_n) stored in row-major order, the stride of axis k is the product of all axis lengths to its right:
so that the linear position of the component addressed by (i₁, ..., i_n) is Σₖ iₖ · strideₖ.
Row-Major Versus Column-Major Convention
Row-major layout stores the last axis contiguously (adjacent values differ only in the final index), while column-major layout stores the first axis contiguously instead; the two conventions produce different stride formulas for the same shape and require care whenever data is exchanged between systems that adopt different conventions, since misinterpreting the layout silently transposes the perceived array.
Diagram of Array Layout
Operations Native to the Array Area
Reshaping
Because the total component count is fixed by the shape's product, an array can be reshaped into any other shape with the same product purely by reinterpreting the linear sequence of stored values under a new stride formula, without moving or recomputing any of the underlying data; this operation belongs entirely to the array area, since it changes only how the fixed set of components is addressed, not their values.
Transposition as a Stride Permutation
Transposing an array's axes can be implemented either by physically rearranging the stored data or, more efficiently, by simply permuting the stride values associated with each axis, leaving the underlying linear storage untouched; this "view" style of transposition is a hallmark technique of the array area, exploiting the separation between logical index order and physical storage order.
Contiguity and Its Computational Consequences
An array is contiguous when its strides match the row-major or column-major formula exactly for its current shape; non-contiguous arrays, produced for instance by certain reshaping or slicing operations, may require an explicit copy before they can be passed to routines that assume contiguous storage, since the assumed stride pattern is a precondition many low-level numerical routines rely on for performance.
Why the Array Area Is Distinct From the Tensor's Mathematical Content
A Computational Layer, Not a Mathematical One
Nothing about shape, strides, or linearization order affects the mathematical identity of the tensor being represented; two different stride arrangements storing the identical set of labeled component values represent the same tensor, differing only in how efficiently various operations can be performed on the underlying memory. The array area is therefore properly understood as an implementation concern layered on top of the mathematical component concept, essential for computation but silent on any question of tensor algebra itself.