def TensorReads
bendtorch-core@0.1.0.0 · src/tensor/construction_totality.bend:7
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
7def TensorReads(+shape: Shape.Shape, result: Result<&2, &1, Core.Error, Core.Tensor<shape>>) -> Type:
8 match result:
9 case Fail{error}:
10 Unit
11 case Done{tensor}:
12 @+index: U32 -> @inside: {Nat.is_lt(U32.to_nat(index), Shape.logical_numel(Shape.dimensions(shape))) == True{} : Bool} ->
13 TransformTotality.ReadSuccess<shape, tensor, index>