def rebump

bendtorch-core@0.1.0.0 · src/autograd/tensor_chain_PROOF.bend:173

import bendtorch-core@0.1.0.0/src/autograd/tensor_chain_PROOF.bend as TensorChainPROOF
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/autograd/gradient.bend as Gradient
import bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend as Backward
import bendtorch-core@0.1.0.0/src/autograd/tensor_chain_LAWS.bend as Laws

173def rebump(-rest: Laws.Log(), +count: Nat, +target: Nat, +shape: Shape.Shape, -gradient: Core.Dynamic, -pending: List<&1, Gradient.Slot>,
174  -slots: List<&1, Gradient.Slot>, -log: Laws.Log(),
175  out: Bumped<pending, count, target, shape, gradient, Backward.at_head(count, target), slots, log>,
176  ih: @state: Laws.Slots() -> @-slots2: List<&1, Gradient.Slot> -> @-log2: Laws.Log() -> @pushed2: Pushed(state, slots2, count, log2) ->
177    Delivered<rest, state, count, slots2, log2>) ->
178  Delivered<Backward.Contribution{target, shape, gradient} <> rest, Done{pending}, count, slots, log>:
179  Bumped{state, bumped, pushed} = out
180  relay(rest, count, target, shape, gradient, pending, slots, log, state, bumped,
181    ih(state, slots, Backward.Contribution{target, shape, gradient} <> log, pushed))

Uses (14)

Used by (1)