SumDims.limit: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/autograd/sum_dims.bend as SumDims Lines 66-73 of bendtorch-core@0.1.0.0/src/autograd/sum_dims.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/autograd/sum_dims.bend&start_line=66&end_line=73 import Base import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape # How many axes an input of these dimensions has for PyTorch's check: its # rank, and 1 for a rank-0 input. def limit(dimensions: List<&2, U32>) -> U32: match dimensions: case Nil{}: 1 case +extent <> +rest: U32.from_nat(Shape.rank_dimensions(extent <> rest)) 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=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.from_nat https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=rank_dimensions