def stepped

bendtorch-core@0.1.0.0 · src/autograd/tensor_chain_PROOF.bend:390

import bendtorch-core@0.1.0.0/src/autograd/tensor_chain_PROOF.bend as TensorChainPROOF
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
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
import bendtorch-core@0.1.0.0/src/autograd/tensor_chain_LAWS.bend as Laws

390def stepped(+node: Backward.Node, +shape: Shape.Shape, -value: Core.Dynamic, saved: Backward.Saved, -slot: Gradient.Slot,
391  -rest: List<&1, Backward.Entry>, pending: List<&1, Gradient.Slot>, +count: Nat, -slots: List<&1, Gradient.Slot>, -log: Laws.Log(),
392  pushed: Pulls(pending, slots, count, log),
393  ih: @state: Laws.Slots() -> @-slots2: List<&1, Gradient.Slot> -> @+count2: Nat -> @-log2: Laws.Log() ->
394    @pushed2: Pushed(state, slots2, count2, log2) -> Out(rest, state, count2, slots2, log2)) ->
395  Run<Backward.Entry{node, shape, value, saved, slot} <> rest, pending, count, slots, log>:
396  match pending count:
397    case Nil{} count:
398      Kept{Backward.Entry{node, shape, value, saved, slot} <> rest, Nil{}, {==},
399        Equal.cong(List<&1, Gradient.Slot>, Laws.Slots(),
400          list => Laws.chained(Backward.Entry{node, shape, value, saved, slot} <> rest, list, count, log), slots, Nil{}, pushed)}
401    case Con{x, more} 0n:
402      Kept{Backward.Entry{node, shape, value, saved, slot} <> rest, Nil{}, {==},
403        Equal.cong(List<&1, Gradient.Slot>, Laws.Slots(),
404          list => Laws.chained(Backward.Entry{node, shape, value, saved, slot} <> rest, list, 0n, log), slots, x <> more, pushed)}
405    case Con{x, more} 1n+below:
406      slot_step(node, shape, value, saved, slot, rest, x, more, below, slots, log, pushed, ih)

Uses (17)

Used by (1)