def position

bendtorch-core@0.1.0.0 · src/tensor/gather_LAWS.bend:223

import bendtorch-core@0.1.0.0/src/tensor/gather_LAWS.bend as GatherLAWS
import Base

223# The cells of the builds, in the coordinates of the views: cell (o, k, r)
224# of [outer, rows, inner] sits at (o * rows + k) * inner + r.
225def position(+rows: Nat, +inner: Nat, +o: Nat, +k: Nat, +r: Nat) -> Nat:
226  Nat.add(Nat.mul(Nat.add(Nat.mul(o, rows), k), inner), r)

Uses (3)

Used by (8)