def Train.dump
import bendtorch@1.3.0.0/main.bend as Bendtorchimport Base
3504# every number of a training state: the parameters, then the first moments, the second moments, b1^t and b2^t (packed
3505# moments: their tree's cells, pt_store's layout, in place of the two moments)
3506def Train.dump(~P: Type, ~X: Type, ~Y: Type, ~S: Type, ~m: Layer<P, X, Y, S>, tr: Train<P>) -> TrainPL<P>:
3507 match tr:
3508 case Train{p, g, NoMom{}, +p1, +p2, +l}:
3509 td0(P, g, p1, p2, l, Layer.dump(P, X, Y, S, m, p))
3510 case Train{p, g, OneMom{mm}, +p1, +p2, +l}:
3511 td1(P, g, p1, p2, l, Layer.dump(P, X, Y, S, m, p), Layer.dump(P, X, Y, S, m, mm))
3512 case Train{p, g, TwoMom{mm, vv}, +p1, +p2, +l}:
3513 td3(P, g, p1, p2, l, Layer.dump(P, X, Y, S, m, p), Layer.dump(P, X, Y, S, m, mm), Layer.dump(P, X, Y, S, m, vv))
3514 case Train{p, g, Packed{t}, +p1, +p2, +l}:
3515 tdp(P, g, p1, p2, l, Layer.dump(P, X, Y, S, m, p), pt_cells(t))
Uses (10)
Used by (0)
No other definition uses this definition.