def unflatten_checked.finish

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

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

716def unflatten_checked.finish(+shape: Shape, +index: Nat, verdict: BoolCase<Nat.is_lt(index, elements(shape))>) -> Result<&2, &2, Error, CheckedCoordinate<shape>>:
717  match verdict:
718    case BFalse{equal}:
719      Fail{FlatIndexOutOfBounds{}}
720    case BTrue{equal}:
721      coordinate_checked.nat(shape, digits_words(dimensions(shape), index))

Uses (11)

Used by (2)