Reduce.first_digit: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/autograd/reduce.bend as Reduce Lines 51-58 of bendtorch-core@0.1.0.0/src/autograd/reduce.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/autograd/reduce.bend&start_line=51&end_line=58 import Base import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape # The first digit a row walks: 0 on a reduced axis (`Nat.div` by 0 is 0), # else the digit `target` names there. def first_digit(+rows: List<&2, Shape.Row>, +target: Nat) -> Nat: match rows: case Nil{}: 0n case Shape.Row{stride, +left, right} <> rest: Nat.div(target, left) 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=Nat.div https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=Row