Gather.entry: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/gather.bend as Gather Lines 239-244 of bendtorch-core@0.1.0.0/src/tensor/gather.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/tensor/gather.bend&start_line=239&end_line=244 import Base # Output cell `at` is (o, k, r) of [outer, length, inner]; with entry j, it # reads input cell (o, j, r) of [outer, extent, inner]. def entry(+plan: Plan, +at: Nat) -> Nat: Plan{+kind, +outer, +extent, +inner, +length} = plan +row = Nat.div(at, inner) entry_of(kind, length, inner, Nat.div(row, length), Nat.mod(row, length), Nat.mod(at, inner)) Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.div https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mod https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/gather.bend&name=Plan https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/gather.bend&name=entry_of