def gradients
import bendtorch-core@0.1.0.0/src/autograd/backward.bend as Backwardimport Base
217# The gradients of one backward of output, newest first, read from the nodes
218# alone. An output the tape does not hold is refused with UnknownNode; a tape
219# with a node that refers to itself or to a newer or missing node is refused
220# with DanglingOperand.
221def gradients(tape: Tape, +output: Nat) -> Result<&2, &2, Error, List<&2, Maybe<&2, F32>>>:
222 Tape{entries} = tape
223 planned(nodes(entries), output)