hasktorch-0.2.1.6: Haskell bindings to libtorch, supporting both typed and untyped tensors.
Safe HaskellNone
LanguageHaskell2010

Torch.Typed.Serialize

Synopsis

Documentation

save Source #

Arguments

:: forall (tensors :: [Type]). Castable (HList tensors) [ATenTensor] 
=> HList tensors

list of input tensors

-> FilePath

file

-> IO () 

save list of tensors to file

load Source #

Arguments

:: forall (tensors :: [Type]). Castable (HList tensors) [ATenTensor] 
=> FilePath

file

-> IO (HList tensors) 

load list of tensors from file

saveParameters :: forall model (parameters :: [Type]) (tensors :: [Type]) dtype device. (Parameterized model, parameters ~ Parameters model, HMap' ToDependent parameters tensors, HMapM' IO MakeIndependent tensors parameters, HFoldrM IO TensorListFold [ATenTensor] tensors [ATenTensor], Apply TensorListUnfold [ATenTensor] (HUnfoldMRes IO [ATenTensor] tensors), HUnfoldM IO TensorListUnfold (HUnfoldMRes IO [ATenTensor] tensors) tensors) => model -> FilePath -> IO () Source #

loadParameters :: forall model (parameters :: [Type]) (tensors :: [Type]) dtype device. (Parameterized model, parameters ~ Parameters model, HMap' ToDependent parameters tensors, HMapM' IO MakeIndependent tensors parameters, HFoldrM IO TensorListFold [ATenTensor] tensors [ATenTensor], Apply TensorListUnfold [ATenTensor] (HUnfoldMRes IO [ATenTensor] tensors), HUnfoldM IO TensorListUnfold (HUnfoldMRes IO [ATenTensor] tensors) tensors) => model -> FilePath -> IO model Source #

loadParametersWithSpec :: forall spec model (parameters :: [Type]) (tensors :: [Type]) dtype device. (Randomizable spec model, Parameterized model, parameters ~ Parameters model, HMap' ToDependent parameters tensors, HMapM' IO MakeIndependent tensors parameters, HFoldrM IO TensorListFold [ATenTensor] tensors [ATenTensor], Apply TensorListUnfold [ATenTensor] (HUnfoldMRes IO [ATenTensor] tensors), HUnfoldM IO TensorListUnfold (HUnfoldMRes IO [ATenTensor] tensors) tensors) => spec -> FilePath -> IO model Source #