def Mat.load

bendtorch@1.3.0.0 · main.bend:1020

import bendtorch@1.3.0.0/main.bend as Bendtorch
import Base
import bend-ml-tensor-array@0.1.18.0/main.bend as TA

1020# an r x c matrix stored as r*c little-endian F32 from byte off of a file
1021def Mat.load(+r: Nat, +c: Nat, +path: String, +off: U32) -> IO(TA.Mat<r, c>):
1022  do IO<TA.Mat<r, c>>:
1023    bs : List<&2, U32> <- read_at(path, off, (U32.from_nat(Nat.mul(r, c)) * 4 : U32))
1024    mat_or_die(r, c, path, TA.Mat.of_list(r, c, f32s(bs)))

Uses (14)

Used by (0)

No other definition uses this definition.