| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Torch.Typed.Serialize
Synopsis
- save :: forall (tensors :: [Type]). Castable (HList tensors) [ATenTensor] => HList tensors -> FilePath -> IO ()
- load :: forall (tensors :: [Type]). Castable (HList tensors) [ATenTensor] => FilePath -> IO (HList tensors)
- 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 ()
- 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
- 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
Documentation
Arguments
| :: forall (tensors :: [Type]). Castable (HList tensors) [ATenTensor] | |
| => HList tensors | list of input tensors |
| -> FilePath | file |
| -> IO () |
save list of tensors to file
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 #