def natural_step_decided
bendtorch-core@0.1.0.0 · src/tensor/elementwise.bend:207
import bendtorch-core@0.1.0.0/src/tensor/elementwise.bend as Elementwise
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/tensor/lifecycle.bend as Lifecycle
207def natural_step_decided(+operation: Operation, +plan: Shape.BroadcastPlan, +cursor: Nat, +index: U32,
208 state: State<Shape.output_shape(plan)>, decision: Shape.BoolCase<Nat.is_eq(U32.to_nat(index), cursor)>) ->
209 NaturalStep<Shape.output_shape(plan), cursor>:
210 match decision:
211 case Shape.BFalse{equal}:
212 natural_conversion_error(Shape.output_shape(plan), cursor, state)
213 case Shape.BTrue{equal}:
214 natural_step_result(Shape.output_shape(plan), cursor, index,
215 Lifecycle.natural_equal(U32.to_nat(index), cursor, equal), step(operation, plan, index, state))