Gather.scattered: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/gather.bend as Gather Lines 336-340 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=336&end_line=340 import Base # Input cell `at` is (o, i, r) of [outer, extent, inner]. def scattered(+plan: Plan, +at: Nat, state: Array & Array) -> F32 & (Array & Array): Plan{+kind, +outer, +extent, +inner, +length} = plan +row = Nat.div(at, inner) added(plan, Nat.div(row, extent), Nat.mod(row, extent), Nat.mod(at, inner), length, 0n, (0.0, state)) Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 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=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 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=added