def fitted_success
bendtorch-core@0.1.0.0 · src/autograd/reduce_PROOF.bend:439
import bendtorch-core@0.1.0.0/src/autograd/reduce_PROOF.bend as ReducePROOF
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/storage/arith.bend as Arith
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/layout.bend as Layout
import bendtorch-core@0.1.0.0/src/tensor/transform_PROOF.bend as TransformProof
import bendtorch-core@0.1.0.0/src/tensor/allocation_PROOF.bend as AllocationProof
import bendtorch-core@0.1.0.0/src/autograd/reduce.bend as Reduce
import bendtorch-core@0.1.0.0/src/autograd/reduce_LAWS.bend as Laws
439def fitted_success(+shape: Shape.Shape, tensor: Core.Tensor<shape>, +target: Shape.Shape, +plan: Shape.BroadcastPlan, same: Bool,
440 -decided: {same == Layout.words_same(Shape.dimensions(Shape.output_shape(plan)), Shape.dimensions(shape)) : Bool},
441 -truth: {Shape.dimensions(Shape.output_shape(plan)) == Shape.dimensions(shape) : List<&2, U32>}) ->
442 Laws.Success<Reduce.fitted(Core.Packed{shape, tensor}, target, plan, same)>:
443 match same:
444 case False{}:
445 Laws.Success{Empty.absurd({False{} == True{} : Bool},
446 Arith.clash(Equal.trans(Bool, False{}, Layout.words_same(Shape.dimensions(Shape.output_shape(plan)), Shape.dimensions(shape)), True{}, decided,
447 %truth : {Layout.words_same(Shape.dimensions(Shape.output_shape(plan)), _) == True{} : Bool}
448 TransformProof.words_same_refl(Shape.dimensions(Shape.output_shape(plan))))))}
449 case True{}:
450 parallel_success(shape, tensor, target, plan, Core.new(target, 0.0), AllocationProof.core_new_done(target, 0.0))