def St.got

bendtorch-load@1.3.0.0 · main.bend:487

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

487def St.got(+path: String, +name: String, +n: U32, r: File & (Array<F32> & Result<&1, &1, U32 & String, U32>), k: File -> Array<F32> -> U32 -> IO(Array<F32>)) -> IO(Array<F32>):
488  match r:
489    case Tuple{f, Tuple{a, res}}:
490      do IO<Array<F32>>:
491        +got : U32 <- IO.pass(U32, res)
492        require(U32.is_eq(got, n), path ++ ": tensor " ++ name ++ ": short read (" ++ U32.show(got) ++ " of " ++ U32.show(n) ++ " numbers)")
493        k(f, a, n)

Uses (16)

Used by (1)