def right_walk_bound
bendtorch-core@0.1.0.0 · src/tensor/elementwise_parallel_proof.bend:367
import bendtorch-core@0.1.0.0/src/tensor/elementwise_parallel_proof.bend as ElementwiseParallelProof
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/shape/flat.bend as Flat
import bendtorch-core@0.1.0.0/src/tensor/elementwise.bend as Elementwise
367def right_walk_bound(+plan: Shape.BroadcastPlan,
368 +map: Shape.Index<Shape.extents(Shape.left_shape(plan)), Shape.extents(Shape.right_shape(plan)), Shape.extents(Shape.output_shape(plan))>,
369 +value: Nat, +bound: {True{} == Nat.is_lt(value, Shape.elements(Shape.output_shape(plan))) : Bool}) ->
370 {True{} == Nat.is_lt(Elementwise.right_walk(Shape.extents(Shape.left_shape(plan)), Shape.extents(Shape.right_shape(plan)), Shape.extents(Shape.output_shape(plan)), map, value),
371 Shape.elements(Shape.right_shape(plan))) : Bool}:
372 match map:
373 case Shape.Indexed{rows, exact}:
374 Flat.right_bound(plan, rows, exact, value, bound)
375 case Shape.Unindexed{zero}:
376 Empty.absurd({True{} == Nat.is_lt(0n, Shape.elements(Shape.right_shape(plan))) : Bool}, Flat.hollow(Shape.output_shape(plan), value, zero, bound))