def read_st

bend-ml-llama@0.2.1.0 · main.bend:1638

import bend-ml-llama@0.2.1.0/main.bend as BendMlLlama
import Base

1638# w/st.txt's numbers, two for each of the 2 + 9 * layers tensors
1639def read_st(+dir: String, +layers: Nat) -> IO(List<&2, U32>):
1640  do IO<List<&2, U32>>:
1641    bs : List<&2, U32> <- read_bytes(dir ++ "/w/st.txt")
1642    +xs : List<&2, U32> = u32s(bs)
1643    st_check(Nat.is_eq(List.length(&2, U32, xs), Nat.mul(2n, Nat.add(2n, Nat.mul(9n, layers)))), dir, xs)

Uses (14)

Used by (2)