def completed_tensor

bendtorch-core@0.1.0.0 · src/tensor/construction_PROOF.bend:648

import bendtorch-core@0.1.0.0/src/tensor/construction_PROOF.bend as ConstructionPROOF
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/storage/arith.bend as Arith
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/allocation_spec.bend as Allocation
import bendtorch-core@0.1.0.0/src/tensor/transform_PROOF.bend as TransformProof
import bendtorch-core@0.1.0.0/src/tensor/construction_totality.bend as Totality

648def completed_tensor(+shape: Shape.Shape, result: Result<&2, &1, Core.Error, Core.Tensor<shape>>,
649  -successful: {Result.is_done(&2, &1, Core.Error, Core.Tensor<shape>, result) == True{} : Bool}) -> Totality.TensorDone<shape, result>:
650  match result:
651    case Fail{error}:
652      Totality.TensorDone{Empty.absurd(Allocation.TensorDone<shape, Fail{error}>, Arith.clash(successful)), successful, Unit{}}
653    case Done{tensor}:
654      Totality.TensorDone{Allocation.TensorDone{tensor, {==}}, {==}, index => inside =>
655        TransformProof.read_success_status(shape, tensor, index, TransformProof.read_success(shape, tensor, index, inside))}

Uses (13)

Used by (1)