Bendtorch.Mat.load: def of bendtorch@1.3.0.0 Import: import bendtorch@1.3.0.0/main.bend as Bendtorch Lines 1020-1024 of bendtorch@1.3.0.0/main.bend: https://jend.leeeet.dev/read.txt?path=bendtorch@1.3.0.0/main.bend&start_line=1020&end_line=1024 import Base import bend-ml-tensor-array@0.1.18.0/main.bend as TA # an r x c matrix stored as r*c little-endian F32 from byte off of a file def Mat.load(+r: Nat, +c: Nat, +path: String, +off: U32) -> IO(TA.Mat): do IO>: bs : List<&2, U32> <- read_at(path, off, (U32.from_nat(Nat.mul(r, c)) * 4 : U32)) mat_or_die(r, c, path, TA.Mat.of_list(r, c, f32s(bs))) Uses (14): 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=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mul 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=Base/base.bend&name=U32.from_nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.mul https://jend.leeeet.dev/definition.txt?path=bend-ml-tensor-array@0.1.19.0/main.bend&name=Mat https://jend.leeeet.dev/definition.txt?path=bend-ml-tensor-array@0.1.19.0/main.bend&name=Mat.of_list https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=f32s https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=mat_or_die https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=read_at