Save & load
Loading and saving functions.
load(path_or_file, model_like)
Loads model data contained in a file into a model_like
structure.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path_or_file |
The file location to save values to or a binary file-like object. |
required | |
model_like |
A PyTree model of same structure, and with leaves of the same type, as the PyTree being loaded. Those leaves which are loaded will replace the corresponding leaves of like. |
required |
Source code in src/somap/serialisation.py
save(path_or_file, model)
Saves model data to file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path_or_file |
The file location to save values to or a binary file-like object. |
required | |
model |
The PyTree model whose leaves will be saved |
required |