def entry_at
import bendtorch-core@0.1.0.0/src/tensor/gather_LAWS.bend as GatherLAWSimport 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)