def indices

bendtorch-core@0.1.0.0 · src/shape/core.bend:174

import bendtorch-core@0.1.0.0/src/shape/core.bend as Core
import Base

174def indices(+dims: List<&2, Nat>, coordinate: Coordinate(dims)) -> List<&2, Nat>:
175  match dims:
176    case Nil{}:
177      Nil{}
178    case +head <> +tail:
179      CStep{index, rest} = coordinate
180      Fin.value(head, index) <> indices(tail, rest)

Uses (5)

Used by (33)