def completed_count

bendtorch-core@0.1.0.0 · src/tensor/construction_metadata.bend:48

import bendtorch-core@0.1.0.0/src/tensor/construction_metadata.bend as ConstructionMetadata
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/observation.bend as Observation

48def completed_count(+shape: Shape.Shape, result: Result<&2, &1, Core.Error, Core.Tensor<shape>>,
49  successful: {Result.is_done(&2, &1, Core.Error, Core.Tensor<shape>, result) == True{} : Bool}) ->
50  {Observation.count(shape, result) == Some{Shape.count(shape)} : Maybe<&2, U32>}:
51  match result:
52    case Fail{error}:
53      Empty.absurd({None{} == Some{Shape.count(shape)} : Maybe<&2, U32>}, Arith.clash(successful))
54    case Done{tensor}:
55      {==}

Uses (12)

Used by (2)