def bounded
import bendtorch-core@0.1.0.0/src/tensor/axis_spec.bend as AxisSpecimport Base
100def bounded(axes: List<&2, Nat>, +rank: Nat) -> Bool:
101 match axes:
102 case Nil{}:
103 True{}
104 case head <> tail:
105 Bool.and(Nat.is_lt(head, rank), bounded(tail, rank))