Bendtorch.Train.restore: def of bendtorch@1.3.0.0 Import: import bendtorch@1.3.0.0/main.bend as Bendtorch Lines 3576-3587 of bendtorch@1.3.0.0/main.bend: https://jend.leeeet.dev/read.txt?path=bendtorch@1.3.0.0/main.bend&start_line=3576&end_line=3587 import Base # a training state filled from the numbers Train.dump wrote (its buffers are overwritten in place; packed moments are # built again from the tree's cells) def Train.restore(~P: Type, ~X: Type, ~Y: Type, ~S: Type, ~m: Layer, tr: Train

, xs: Array) -> Train

: match tr: case Train{p, g, NoMom{}, p1, p2, l}: tr0(P, g, Layer.load(P, X, Y, S, m, p, xs, 0)) case Train{p, g, OneMom{mm}, p1, p2, l}: tr_m1(~P, ~X, ~Y, ~S, ~m, mm, g, Layer.load(P, X, Y, S, m, p, xs, 0)) case Train{p, g, TwoMom{mm, vv}, p1, p2, l}: tr1(~P, ~X, ~Y, ~S, ~m, mm, vv, g, Layer.load(P, X, Y, S, m, p, xs, 0)) case Train{p, g, Packed{t}, p1, p2, l}: trp(P, g, Layer.load(P, X, Y, S, m, p, xs, 0)) Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=Layer https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=Layer.load https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=OptState https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=Train https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=tr0 https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=tr1 https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=tr_m1 https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=trp