| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Torch.Serialize
Synopsis
- save :: [Tensor] -> FilePath -> IO ()
- load :: FilePath -> IO [Tensor]
- pickleSave :: IValue -> FilePath -> IO ()
- pickleLoad :: FilePath -> IO IValue
- saveParams :: Parameterized f => f -> FilePath -> IO ()
- loadParams :: Parameterized b => b -> FilePath -> IO b
- class RawFile a where
- loadBinary :: Handle -> a -> IO a
- saveBinary :: Handle -> a -> IO ()
Documentation
Load a state_dict file You should use a dict function of pytorch to save a state_dict file as follows.
torch.save(dict(model.state_dict()), "state_dict.pth")
Arguments
| :: Parameterized f | |
| => f | model |
| -> FilePath | filepath |
| -> IO () | output |
Arguments
| :: Parameterized b | |
| => b | model |
| -> FilePath | filepath |
| -> IO b | output |