Slice.axis_extent: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/slice.bend as Slice Lines 89-98 of bendtorch-core@0.1.0.0/src/tensor/slice.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/tensor/slice.bend&start_line=89&end_line=98 import Base # The extent of axis `dim`, 0 past the rank. It reads that one dimension and # forms no product. def axis_extent(dimensions: List<&2, U32>, +dim: Nat) -> Nat: match dimensions dim: case extent <> rest 0n: U32.to_nat(extent) case extent <> rest 1n+next: axis_extent(rest, next) case Nil{} _: 0n Uses (4): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat