def deliver

bendtorch-core@0.1.0.0 · src/autograd/tensor_backward.bend:740

import bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend as TensorBackward
import Base
import bendtorch-core@0.1.0.0/src/autograd/gradient.bend as Gradient

740def deliver(contributions: List<&1, Contribution>, +count: Nat, state: Result<&2, &1, Error, List<&1, Gradient.Slot>>) ->
741  Result<&2, &1, Error, List<&1, Gradient.Slot>>:
742  match contributions state:
743    case Nil{} state:
744      state
745    case Con{contribution, rest} Fail{error}:
746      Fail{error}
747    case Con{Contribution{+target, +shape, gradient}, rest} Done{slots}:
748      deliver(rest, count, bump(slots, count, target, shape, gradient, at_head(count, target)))

Uses (8)

Used by (6)