def actual_step_success

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

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

694def actual_step_success(+operation: Elementwise.Operation, +plan: Shape.BroadcastPlan, +index: U32,
695  state: Elementwise.State<Shape.output_shape(plan)>,
696  -fits: FittingSources<plan, step_left_owner(Shape.output_shape(plan), Elementwise.Continue{state}), step_right_owner(Shape.output_shape(plan), Elementwise.Continue{state})>,
697  -inside: {Nat.is_lt(U32.to_nat(index), Shape.elements(Shape.output_shape(plan))) == True{} : Bool}) ->
698  StepSuccess<Shape.output_shape(plan), Elementwise.step(operation, plan, index, state)>:
699  Elementwise.State{left, right, output} = state
700  StepSuccess{{\{IndicesDone: li => ri => exact => lb => rb =>
701    %exact : {step_succeeded(Shape.output_shape(plan), Elementwise.step_indices(operation, Shape.output_shape(plan), index, Elementwise.State{left, right, output}, _)) == True{} : Bool}
702    {\{StepSuccess: successful => successful} :
703      StepSuccess<Shape.output_shape(plan), Elementwise.step_left(operation, Shape.output_shape(plan), index, right, output, ri, Core.read_dynamic(left, li))> ->
704      {step_succeeded(Shape.output_shape(plan), Elementwise.step_left(operation, Shape.output_shape(plan), index, right, output, ri, Core.read_dynamic(left, li))) == True{} : Bool}}(
705        step_left_success(operation, Shape.output_shape(plan), index, right, output, ri, Core.read_dynamic(left, li),
706          {\{DynamicReadSuccess: successful => successful} : DynamicReadSuccess<left, li> -> {dynamic_read_succeeded(Core.read_dynamic(left, li)) == True{} : Bool}}(
707            dynamic_read_success(left, li,
708              %Equal.sym(List<&2, U32>, Totality.dimensions(left), Shape.dimensions(Shape.left_shape(plan)),
709                {\{FittingSources: l => r => l} : FittingSources<plan, left, right> -> {Totality.dimensions(left) == Shape.dimensions(Shape.left_shape(plan)) : List<&2, U32>}}(fits)) :
710                {Nat.is_lt(U32.to_nat(li), Shape.logical_numel(_)) == True{} : Bool}
711              lb)),
712          %Equal.sym(List<&2, U32>, Totality.dimensions(right), Shape.dimensions(Shape.right_shape(plan)),
713            {\{FittingSources: l => r => r} : FittingSources<plan, left, right> -> {Totality.dimensions(right) == Shape.dimensions(Shape.right_shape(plan)) : List<&2, U32>}}(fits)) :
714            {Nat.is_lt(U32.to_nat(ri), Shape.logical_numel(_)) == True{} : Bool}
715          rb,
716          %Shape.elements_exact(Shape.output_shape(plan)) : {Nat.is_lt(U32.to_nat(index), _) == True{} : Bool}
717          inside))} : IndicesDone<plan, Elementwise.input_indices(plan, index)> ->
718      {step_succeeded(Shape.output_shape(plan), Elementwise.step(operation, plan, index, Elementwise.State{left, right, output})) == True{} : Bool}}(
719        indices_success(plan, index, inside))}

Uses (34)

Used by (1)