def pass
import bendtorch-core@0.1.0.0/src/autograd/backward.bend as Backwardimport 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)
- bendtorch-core@0.1.0.0/src/autograd/backward:checked
- bendtorch-core@0.1.0.0/src/autograd/backward_LAWS:backward_success
- bendtorch-core@0.1.0.0/src/autograd/backward_PROOF:chosen_reached
- bendtorch-core@0.1.0.0/src/autograd/backward_PROOF:pass_reached
- bendtorch-core@0.1.0.0/src/autograd/backward_LAWS:backward_accepts_bound_operands
- …