def successful_step
bendtorch-core@0.1.0.0 · src/tensor/transform_PROOF.bend:506
import bendtorch-core@0.1.0.0/src/tensor/transform_PROOF.bend as TransformPROOF
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/tensor/layout.bend as Layout
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/transforms.bend as Transforms
506def successful_step(+input: Shape.Shape, +axes: List<&2, U32>, +plan: Layout.Plan<input, axes>, +index: U32,
507 -original_source: Core.Tensor<input>, -original_target: Core.Tensor<Layout.output(input, axes, plan)>,
508 -source: Core.Tensor<input>, -target: Core.Tensor<Layout.output(input, axes, plan)>, +mapping: Layout.Mapping<input, axes, plan, index>,
509 +value: F32, -unit: Unit,
510 -map_exact: {Done{mapping} == Layout.map_index(input, axes, plan, index) : Result<&2, &2, Layout.Error, Layout.Mapping<input, axes, plan, index>>},
511 read_value: SourceValue<input, original_source, Layout.source_index(input, axes, plan, index, mapping), value>,
512 read_kept: SourceKept<input, original_source, source>,
513 update: KnownCheckedUpdate<Layout.output(input, axes, plan), original_target, target, index, value, unit>) ->
514 SuccessfulStep<input, axes, plan, index, original_source, original_target, source, target>:
515 SourceValue{read_equal} = read_value
516 SourceKept{kept} = read_kept
517 KnownCheckedUpdate{meaning} = update
518 SuccessfulStep{(kept,
519 (checked_update_route(Layout.output(input, axes, plan), original_target, target, index, value, unit, meaning),
520 (Equal.trans(Maybe<&2, F32>, Core.checked_observe(Layout.output(input, axes, plan), target, index), Some{value},
521 Transforms.expected_output(input, axes, plan, original_source, index),
522 checked_update_value(Layout.output(input, axes, plan), original_target, target, index, value, unit, meaning),
523 {\{MappedValue: equal => equal} : MappedValue<input, axes, plan, index, original_source, value> ->
524 {Some{value} == Transforms.expected_output(input, axes, plan, original_source, index) : Maybe<&2, F32>}}(
525 mapped_value(input, axes, plan, index, original_source, mapping, value, map_exact, SourceValue{read_equal}))),
526 checked_update_frame(Layout.output(input, axes, plan), original_target, target, index, value, unit, meaning))))}