def entry_at

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

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

228# The entry output cell (o, k, r) of [outer, length, inner] reads: entry k
229# of an index_select's index, the entry at the cell itself of a gather's.
230def entry_at(+kind: Gather.Lookup, +count: Nat, +inner: Nat, +o: Nat, +k: Nat, +r: Nat) -> Nat:
231  match kind:
232    case Gather.Selected{}:
233      k
234    case Gather.Gathered{}:
235      position(count, inner, o, k, r)

Uses (3)

Used by (6)