def reordered_rank_bound
bendtorch-core@0.1.0.0 · src/tensor/permutation_mapping.bend:167
import bendtorch-core@0.1.0.0/src/tensor/permutation_mapping.bend as PermutationMapping
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/tensor/layout.bend as Layout
import bendtorch-core@0.1.0.0/src/tensor/axis_spec.bend as Axis
import bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend as AxisAlgebra
167def reordered_rank_bound(+input: Shape.Shape, +axes: List<&2, U32>, +valid: {True{} == Layout.bijective(input, axes) : Bool}) ->
168 Shape.LE(Shape.rank_dimensions(Axis.order(U32, Shape.dimensions(input), Shape.naturals(axes))), 4n):
169 match input:
170 case Shape.SShape{+dimensions, +size, +exact, +rank_bound, +capacity_bound}:
171 %Equal.sym(Nat, Shape.rank_dimensions(Axis.order(U32, dimensions, Shape.naturals(axes))), Shape.rank_dimensions(dimensions),
172 AxisAlgebra.permutation_rank(Shape.SShape{dimensions, size, exact, rank_bound, capacity_bound}, axes, valid)) : Shape.LE(_, 4n)
173 rank_bound