def sum_packed_status

bendtorch-core@0.1.0.0 · src/tensor/reduction_PROOF.bend:833

import bendtorch-core@0.1.0.0/src/tensor/reduction_PROOF.bend as ReductionPROOF
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/reduction.bend as Reduction
import bendtorch-core@0.1.0.0/src/tensor/math_totality.bend as Totality
import bendtorch-core@0.1.0.0/src/storage/arith.bend as Arith

833def sum_packed_status(+shape: Shape.Shape,
834  result: Result<&2, &1, Core.Error, Core.Tensor<shape> & Core.Tensor<Reduction.scalar_shape()>>,
835  -certificate: Totality.Success<Core.Error, Core.Tensor<shape> & Core.Tensor<Reduction.scalar_shape()>, result>) ->
836  Totality.Status<Core.Error, Core.Dynamic & Core.Dynamic, Reduction.pack_result(shape, result)>:
837  match result:
838    case Fail{error}:
839      Totality.Status{{\{Totality.Success: successful => witness => Empty.absurd({False{} == True{} : Bool}, Arith.clash(successful))} :
840        Totality.Success<Core.Error, Core.Tensor<shape> & Core.Tensor<Reduction.scalar_shape()>, Fail{error}> -> {False{} == True{} : Bool}}(certificate)}
841    case Done{pair}:
842      (tensor, scalar) = pair
843      Totality.Status{{==}}

Uses (14)

Used by (1)