def held_checked_refusal

bendtorch-core@0.1.0.0 · src/autograd/gradient_PROOF.bend:799

import bendtorch-core@0.1.0.0/src/autograd/gradient_PROOF.bend as GradientPROOF
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/layout.bend as Layout
import bendtorch-core@0.1.0.0/src/tensor/elementwise_totality.bend as Totality
import bendtorch-core@0.1.0.0/src/autograd/gradient.bend as Gradient
import bendtorch-core@0.1.0.0/src/autograd/gradient_LAWS.bend as Laws

799def held_checked_refusal(+shape: Shape.Shape, contribution: Core.Dynamic, +total_shape: Shape.Shape, total: Core.Tensor<total_shape>, same: Bool,
800  -decided: {same == Layout.words_same(Shape.dimensions(total_shape), Shape.dimensions(shape)) : Bool},
801  -agrees: {Totality.dimensions(contribution) == Shape.dimensions(shape) : List<&2, U32>}) ->
802  Holds<Laws.RefusalKeeps(Gradient.Held{Core.Packed{total_shape, total}}, contribution, Gradient.held_checked(contribution, total_shape, total, same))>:
803  match same:
804    case False{}:
805      Holds{({==}, (property => {==}, ({==}, index => {==})))}
806    case True{}:
807      accumulated_keeps(Gradient.Held{Core.Packed{total_shape, total}}, contribution,
808        Gradient.loop(Shape.elements(total_shape), total_shape, 0n, Gradient.State{contribution, total}),
809        {\{Laws.Success: successful => successful} :
810          Laws.Success<Gradient.loop(Shape.elements(total_shape), total_shape, 0n, Gradient.State{contribution, total})> ->
811          {Laws.accumulated(Gradient.loop(Shape.elements(total_shape), total_shape, 0n, Gradient.State{contribution, total})) == True{} : Bool}}(
812          held_checked_success(shape, contribution, total_shape, total, True{}, decided,
813            {\{Holds: proof => proof} : Holds<{Shape.dimensions(total_shape) == Shape.dimensions(shape) : List<&2, U32>}> ->
814              {Shape.dimensions(total_shape) == Shape.dimensions(shape) : List<&2, U32>}}(words_dimensions(total_shape, shape, decided)),
815            agrees)))

Uses (22)

Used by (1)