def valid
bendtorch-core@0.1.0.0 · src/tensor/axis_algebra.bend:137
import bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend as AxisAlgebra
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
137def valid(+shape: Shape.Shape, +axes: List<&2, U32>, accepted: {True{} == Layout.bijective(shape, axes) : Bool}) ->
138 {True{} == Axis.valid(Shape.rank_dimensions(Shape.dimensions(shape)), Shape.naturals(axes)) : Bool}:
139 %Shape.rank_naturals(axes) : {True{} == Bool.and(Nat.is_eq(_, Shape.rank_dimensions(Shape.dimensions(shape))), Bool.and(Axis.bounded(Shape.naturals(axes), Shape.rank_dimensions(Shape.dimensions(shape))), Axis.unique(Shape.naturals(axes)))) : Bool}
140 %unique(axes) : {True{} == Bool.and(Nat.is_eq(Shape.rank_dimensions(axes), Shape.rank_dimensions(Shape.dimensions(shape))), Bool.and(Axis.bounded(Shape.naturals(axes), Shape.rank_dimensions(Shape.dimensions(shape))), _)) : Bool}
141 %rank_exact(shape) : {True{} == Bool.and(Nat.is_eq(Shape.rank_dimensions(axes), Shape.rank_dimensions(Shape.dimensions(shape))), Bool.and(Axis.bounded(Shape.naturals(axes), _), Layout.unique(axes))) : Bool}
142 %bounded(axes, Shape.rank(shape)) : {True{} == Bool.and(Nat.is_eq(Shape.rank_dimensions(axes), Shape.rank_dimensions(Shape.dimensions(shape))), Bool.and(_, Layout.unique(axes))) : Bool}
143 accepted