SliceLAWS.position: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/slice_LAWS.bend as SliceLAWS Lines 323-328 of bendtorch-core@0.1.0.0/src/tensor/slice_LAWS.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/tensor/slice_LAWS.bend&start_line=323&end_line=328 import Base # The cells of the builds, in the coordinates of the views: output cell # (o, k, r) of [outer, length, inner] sits at row-major position # (o * length + k) * inner + r, and input cell (o, i, r) of [outer, extent, # inner] at (o * extent + i) * inner + r. def position(+rows: Nat, +inner: Nat, +o: Nat, +i: Nat, +r: Nat) -> Nat: Nat.add(Nat.mul(Nat.add(Nat.mul(o, rows), i), 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