BendtorchLoad.piece: def of bendtorch-load@1.3.0.0
Import: import bendtorch-load@1.3.0.0/main.bend as BendtorchLoad
Lines 592-598 of bendtorch-load@1.3.0.0/main.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-load@1.3.0.0/main.bend&start_line=592&end_line=598
import Base
import bendtorch@1.3.0.0/main.bend as T
# One layer's parameters from the file whose header is h: `layout` names its tensors in Layer.dump order, and
# Layer.load fills them; the array they were read into is gone once this answers
def piece(~P: Type, ~X: Type, ~Y: Type, ~S: Type, ~m: T.Layer
, +path: String, h: Header, +layout: List<&2, Entry>, p: P) -> IO(P):
do IO
:
+n : U32 = T.Layer.count(P, X, Y, S, m)
a : Array <- tensors_from(path, h, n, layout)
weights_done(P, n, T.Layer.load(P, X, Y, S, m, p, a, 0))
Uses (14):
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=Base/base.bend&name=IO
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32
https://jend.leeeet.dev/definition.txt?path=bendtorch-load@1.3.0.0/main.bend&name=Entry
https://jend.leeeet.dev/definition.txt?path=bendtorch-load@1.3.0.0/main.bend&name=Header
https://jend.leeeet.dev/definition.txt?path=bendtorch-load@1.3.0.0/main.bend&name=tensors_from
https://jend.leeeet.dev/definition.txt?path=bendtorch-load@1.3.0.0/main.bend&name=weights_done
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.count
https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=Layer.load