Coordinate geometry of checked transformations #
This module turns the grouped axes of a checked transform into coordinate maps, equivalences, and finite fibers. It contains no tensor denotation or lowering program.
The input tensor type of a checked transformation.
Instances For
The output tensor type of a checked transformation.
Instances For
Convert a checked input tensor coordinate to coordinates of its elementary axes.
Instances For
Convert a checked output tensor coordinate to coordinates of its elementary axes.
Instances For
The coordinate permutation certified by a checked rearrange plan.
Both normalized axis lists are duplicate-free and contain the same axes, so selection in either direction gives mutually inverse coordinate maps.
Instances For
Map an output tensor coordinate to its input coordinate when every input axis occurs in the output.
For repeat this forgets newly introduced output axes. For rearrange it permutes the same elementary coordinates.
Instances For
Map an input tensor coordinate to its output coordinate when every output axis occurs in the input.
For reduction this forgets the axes being aggregated. For rearrange it gives the inverse axis permutation.
Instances For
The rearrange equivalence applies the general output-to-input coordinate map.
The inverse rearrange equivalence applies the input-to-output coordinate map.
Mapping an input rearrange coordinate to the output and back is the identity.
Mapping an output rearrange coordinate to the input and back is the identity.
Rearrangement preserves the total number of tensor entries.
Every input coordinate has exactly one output coordinate under a checked rearrangement. Thus rearrange neither drops nor duplicates tensor entries, including for rank-zero and zero-size shapes.
Every input coordinate of a checked repeat is selected once for each setting of the newly introduced output axes.
The cardinality is therefore the product of their lengths. This also covers the two boundary cases: no introduced axes give multiplicity one, while an introduced zero-length axis gives an empty fiber.
Input axes removed by a checked reduction, in their original input order.
Instances For
The physical shape traversed inside one reduction fiber.
Its axis order is inherited from the input pattern, so flat indices enumerate the removed coordinates in the tensor's row-major order.
Instances For
The number of input coordinates aggregated into each output coordinate of a checked reduction.
The value is one when no axis is removed and zero exactly when at least one removed axis has length zero.
Instances For
The row-major reduction shape contains exactly one entry per fiber value.
One reduction-fiber coordinate is exactly one assignment of every input axis removed from the output.
The equivalence is independent of tensor rank, grouping, and axis lengths. It therefore also covers scalar reductions, reductions that remove no axes, and empty fibers caused by zero-length dimensions.
Instances For
Every axis removed by a checked reduction occurs in its input axis list.
The reduction-fiber equivalence reads the removed axes from the complete input-axis assignment.
Every output coordinate of a checked reduction aggregates one input coordinate for each setting of the removed axes.
The fiber cardinality is the product of the removed-axis lengths. Thus reducing no axes gives a singleton fiber, while removing any zero-length axis gives an empty fiber over every output coordinate.
A positive checked reduction-fiber size gives a nonempty coordinate fiber at every output position.