def npy_counted

stelliferous@0.0.2.0 · tensor_file.bend:261

import stelliferous@0.0.2.0/tensor_file.bend as TensorFile
import Base
import stelliferous@0.0.2.0/tensor.bend as Tensors

261def npy_counted(count: Maybe<&2,U32>,+shape: List<&2,U32>,data: List<&2,U32>,file: File,+path: String) -> IO(Tensor()):
262  match count:
263    case None{}: refused(file,Tensors.failed(~F32,"load_npy",Tensors.InvalidShape{shape},shape,0.0,1))
264    case Some{+count}:
265      do IO<Tensor()>:
266        outcome : Outcome <- read_all(fuel(count),More{file,fill(data,fresh(count),count)},count)
267        IO.pure(Tensor(),loaded("load_npy",path,shape,outcome,count))

Uses (20)

Used by (1)