GradientLAWS.combined: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/autograd/gradient_LAWS.bend as GradientLAWS Lines 16-25 of bendtorch-core@0.1.0.0/src/autograd/gradient_LAWS.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/autograd/gradient_LAWS.bend&start_line=16&end_line=25 import Base import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core import bendtorch-core@0.1.0.0/src/autograd/gradient.bend as Gradient # The value the specification assigns to one position after a contribution is # accumulated into a slot: an Unset slot takes the contribution's word as it # is, and a Held slot adds the contribution's word to its own with one F32 add, # the held total first. def combined(slot: Gradient.Slot, contribution: Core.Dynamic, +index: U32) -> Maybe<&2, F32>: match slot: case Gradient.Unset{}: Core.checked_observe_dynamic(contribution, index) case Gradient.Held{gradient}: add_word(Core.checked_observe_dynamic(gradient, index), Core.checked_observe_dynamic(contribution, index)) Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/gradient.bend&name=Slot https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/gradient_LAWS.bend&name=add_word https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/core.bend&name=Dynamic https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/core.bend&name=checked_observe_dynamic