def piece

bendtorch-load@1.3.0.0 · main.bend:592

import bendtorch-load@1.3.0.0/main.bend as BendtorchLoad
import Base
import bendtorch@1.3.0.0/main.bend as T

592# One layer's parameters from the file whose header is h: `layout` names its tensors in Layer.dump order, and
593# Layer.load fills them; the array they were read into is gone once this answers
594def piece(~P: Type, ~X: Type, ~Y: Type, ~S: Type, ~m: T.Layer<P, X, Y, S>, +path: String, h: Header, +layout: List<&2, Entry>, p: P) -> IO(P):
595  do IO<P>:
596    +n : U32 = T.Layer.count(P, X, Y, S, m)
597    a : Array<F32> <- tensors_from(path, h, n, layout)
598    weights_done(P, n, T.Layer.load(P, X, Y, S, m, p, a, 0))

Uses (14)

Used by (1)