def coordinate_index

bendtorch-core@0.1.0.0 · src/tensor/observation.bend:198

import bendtorch-core@0.1.0.0/src/tensor/observation.bend as Observation
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape

198def coordinate_index(-shape: Shape.Shape, result: Result<&2, &2, Shape.Error, Shape.FlatIndex<shape>>) -> Maybe<&2, U32>:
199  match result:
200    case Fail{error}:
201      None{}
202    case Done{index}:
203      Some{Shape.index_value(shape, index)}

Uses (7)

Used by (8)