def refusal

bendtorch-core@0.1.0.0 · src/autograd/sgd.bend:87

import bendtorch-core@0.1.0.0/src/autograd/sgd.bend as Sgd
import Base
import bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend as Backward

87# The refusal of the first parameter, in list order, that is not a leaf of
88# the tape, or None when every one is.
89def refusal(+nodes: List<&2, Backward.Node>, +count: Nat, params: List<&2, Nat>) -> Maybe<&2, Error>:
90  match params:
91    case Nil{}:
92      None{}
93    case Con{+id, rest}:
94      first_refusal(refusal_at(nodes, count, id, Backward.at_head(count, id)), refusal(nodes, count, rest))

Uses (8)

Used by (4)