def pass

bendtorch-core@0.1.0.0 · src/autograd/backward.bend:162

import bendtorch-core@0.1.0.0/src/autograd/backward.bend as Backward
import Base

162# The gradient of output with respect to each of count nodes, newest first:
163# None for the nodes newer than output and for every node output does not
164# reach.
165def pass(nodes: List<&2, Node>, +count: Nat, +output: Nat) -> List<&2, Maybe<&2, F32>>:
166  match nodes count:
167    case Nil{} count:
168      Nil{}
169    case Con{node, rest} 0n:
170      Nil{}
171    case Con{node, +rest} 1n+below:
172      chosen(node, rest, below, unit => pass(rest, below, output), Nat.is_eq(below, output))

Uses (7)

Used by (7)