TensorChainLAWS.fired: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/autograd/tensor_chain_LAWS.bend as TensorChainLAWS Lines 94-102 of bendtorch-core@0.1.0.0/src/autograd/tensor_chain_LAWS.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_chain_LAWS.bend&start_line=94&end_line=102 import Base import bendtorch-core@0.1.0.0/src/autograd/gradient.bend as Gradient import bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend as Backward # An entry that holds g after gathering: its VJP's contributions join the log # in operand order, so the first operand's arrives first. def fired(pass: Backward.Pass, log: Log(), rec: Log() -> Slots()) -> Slots(): Backward.Pass{saved, g, contributions} = pass match contributions: case Fail{error}: Fail{error} case Done{items}: Backward.prepend(Gradient.Slot, Gradient.Held{g}, rec(List.reverse.go(&1, Backward.Contribution, items, log))) Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.reverse.go https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/gradient.bend&name=Slot https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend&name=Contribution https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend&name=Pass https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend&name=prepend https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_chain_LAWS.bend&name=Log https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_chain_LAWS.bend&name=Slots