def picks

bendtorch-core@0.1.0.0 · src/tensor/permute_build.bend:57

import bendtorch-core@0.1.0.0/src/tensor/permute_build.bend as PermuteBuild
import Base
import bendtorch-core@0.1.0.0/src/tensor/axis_spec.bend as Axis

57# One pick per input axis, from `cursor` on: the output coordinate that the
58# axes send to it, as `Axis.scatter` selects it.
59def picks(rank: Nat, +axes: List<&2, Nat>, +out: List<&2, Nat>, +cursor: Nat) -> Maybe<&2, List<&2, Pick>>:
60  match rank:
61    case 0n:
62      Some{Nil{}}
63    case 1n+p:
64      Axis.prepend(Pick, located(out, Axis.position(axes, cursor)), picks(p, axes, out, 1n+cursor))

Uses (7)

Used by (3)