def opened
stelliferous@0.0.2.0 · tensor_file.bend:145
import stelliferous@0.0.2.0/tensor_file.bend as TensorFile
import Base
145def opened(result: Result<&1,&1,U32 & String,File>,path: String,+shape: List<&2,U32>,+count: U32) -> IO(Tensor()):
146 match result:
147 case Fail{error}: IO.pure(Tensor(),fault("load",path,"cannot be opened",shape))
148 case Done{file}:
149 do IO<Tensor()>:
150 outcome : Outcome <- read_all(fuel(count),More{file,fresh(count)},count)
151 IO.pure(Tensor(),loaded("load",path,shape,outcome,count))