def ConstructionReads

bendtorch-core@0.1.0.0 · src/tensor/construction_totality.bend:28

import bendtorch-core@0.1.0.0/src/tensor/construction_totality.bend as ConstructionTotality
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/transform_totality.bend as TransformTotality

28def ConstructionReads(+dimensions: List<&2, U32>, result: Result<&2, &1, Core.Error, Core.Dynamic>) -> Type:
29  match result:
30    case Fail{error}:
31      Unit
32    case Done{Core.Packed{+shape, tensor}}:
33      @+index: U32 -> @inside: {Nat.is_lt(U32.to_nat(index), Shape.logical_numel(dimensions)) == True{} : Bool} ->
34        TransformTotality.ReadSuccess<shape, tensor, index>

Uses (11)

Used by (1)