def target

bendtorch-core@0.1.0.0 · src/tensor/slice.bend:261

import bendtorch-core@0.1.0.0/src/tensor/slice.bend as Slice
import Base

261def target(+plan: Plan, +position: Nat) -> Maybe<&2, Nat>:
262  Plan{+outer, +extent, +inner, +start, +step, +length} = plan
263  +row = Nat.div(position, inner)
264  +i = Nat.mod(row, extent)
265  +k = Nat.div(Nat.sub(i, start), step)
266  picked(plan, row, Nat.mod(position, inner), i, k, hits(start, step, length, i, k))

Uses (8)

Used by (8)