def selecting

bendtorch-core@0.1.0.0 · src/tensor/gather.bend:151

import bendtorch-core@0.1.0.0/src/tensor/gather.bend as Gather
import Base
import bendtorch-core@0.1.0.0/src/tensor/layout.bend as Layout
import bendtorch-core@0.1.0.0/src/tensor/slice.bend as Slice

151# The axis check, then the entries against the extent.
152def selecting(+dimensions: List<&2, U32>, +axis: Nat, +entries: List<&2, U32>, in_rank: Bool) -> Result<&2, &2, Error, Planned>:
153  match in_rank:
154    case False{}:
155      Fail{LayoutError{Layout.AxisOutOfBounds{}}}
156    case True{}:
157      ranged(Selected{}, dimensions, axis, entries, count(entries), below(entries, Slice.axis_extent(dimensions, axis)))

Uses (13)

Used by (4)