type Pick

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

import bendtorch-core@0.1.0.0/src/tensor/permute_build.bend as PermuteBuild
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape

19# How to take one output coordinate out of a row-major index: reduce the
20# index modulo each of `mods` in turn, then divide by `size`. Coordinate k
21# of `Shape.digits(dims, x)` takes the element counts after the first k
22# dimensions as `mods` and the count after dimension k as `size`.
23type Pick is Data:
24  Pick{mods: List<&2, Nat>, size: Nat}

Uses (2)

Used by (17)