def planned_success

bendtorch-core@0.1.0.0 · src/tensor/elementwise_PROOF.bend:880

import bendtorch-core@0.1.0.0/src/tensor/elementwise_PROOF.bend as ElementwisePROOF
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/elementwise.bend as Elementwise
import bendtorch-core@0.1.0.0/src/tensor/elementwise_totality.bend as Totality
import bendtorch-core@0.1.0.0/src/shape/LAWS.bend as ShapeLaws
import bendtorch-core@0.1.0.0/src/storage/arith.bend as Arith
import bendtorch-core@0.1.0.0/src/tensor/allocation_PROOF.bend as AllocationProof

880def planned_success(+operation: Elementwise.Operation, +left_shape: Shape.Shape, +right_shape: Shape.Shape,
881  result: Result<&2, &2, Shape.Error, Shape.BroadcastPlan>, left: Core.Tensor<left_shape>, right: Core.Tensor<right_shape>,
882  -built: {ShapeLaws.broadcast_built(result) == True{} : Bool}) ->
883  Totality.Success<Elementwise.parallel_planned(operation, Core.Packed{left_shape, left}, Core.Packed{right_shape, right}, result)>:
884  match result:
885    case Fail{error}:
886      Totality.Success{Empty.absurd({False{} == True{} : Bool}, Arith.clash(built))}
887    case Done{+plan}:
888      parallel_allocated_success(operation, plan, Core.Packed{left_shape, left}, Core.Packed{right_shape, right}, Core.new(Shape.output_shape(plan), 0.0),
889        AllocationProof.core_new_done(Shape.output_shape(plan), 0.0))

Uses (17)

Used by (1)