def step_left_success

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

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/storage/arith.bend as Arith

679def step_left_success(+operation: Elementwise.Operation, +shape: Shape.Shape, +index: U32,
680  right: Core.Dynamic, output: Core.Tensor<shape>, +right_index: U32, pair: Core.Dynamic & Result<&2, &2, Core.Error, F32>,
681  -successful: {dynamic_read_succeeded(pair) == True{} : Bool},
682  -right_inside: {Nat.is_lt(U32.to_nat(right_index), Shape.logical_numel(Totality.dimensions(right))) == True{} : Bool},
683  -inside: {Nat.is_lt(U32.to_nat(index), Shape.logical_numel(Shape.dimensions(shape))) == True{} : Bool}) ->
684  StepSuccess<shape, Elementwise.step_left(operation, shape, index, right, output, right_index, pair)>:
685  (left, result) = pair
686  match result:
687    case Fail{error}:
688      StepSuccess{Empty.absurd({False{} == True{} : Bool}, Arith.clash(successful))}
689    case Done{value}:
690      step_right_success(operation, shape, index, left, output, value, Core.read_dynamic(right, right_index),
691        {\{DynamicReadSuccess: successful => successful} : DynamicReadSuccess<right, right_index> ->
692          {dynamic_read_succeeded(Core.read_dynamic(right, right_index)) == True{} : Bool}}(dynamic_read_success(right, right_index, right_inside)), inside)

Uses (25)

Used by (1)