def naturals

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

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

375def naturals(dims: List<&2, U32>) -> List<&2, Nat>:
376  match dims:
377    case Nil{}:
378      Nil{}
379    case head <> tail:
380      U32.to_nat(head) <> naturals(tail)

Uses (4)

Used by (174)