GatherLAWS.position: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/gather_LAWS.bend as GatherLAWS Lines 223-226 of bendtorch-core@0.1.0.0/src/tensor/gather_LAWS.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/tensor/gather_LAWS.bend&start_line=223&end_line=226 import Base # The cells of the builds, in the coordinates of the views: cell (o, k, r) # of [outer, rows, inner] sits at (o * rows + k) * inner + r. def position(+rows: Nat, +inner: Nat, +o: Nat, +k: Nat, +r: Nat) -> Nat: Nat.add(Nat.mul(Nat.add(Nat.mul(o, rows), k), inner), r) Uses (3): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mul