Serialization#
- metatensor.torch.save(path: str, data: TensorMap | Labels)[source]#
- Save the given data (either - TensorMapor- Labels) to the given file at the given- path.- If the file already exists, it is overwritten. When saving a - TensorMap, the file extension should be- .npz; and when saving- Labelsit should be- .npy
- metatensor.torch.save_buffer(data: TensorMap | Labels) Tensor[source]#
- Save the given data (either - TensorMapor- Labels) to an in-memory buffer, represented as 1-dimensional- torch.Tensorof- uint8.
- metatensor.torch.load(path: str) TensorMap[source]#
- Load a previously saved - TensorMapfrom the given path.- TensorMapare serialized using numpy’s- .npzformat, i.e. a ZIP file without compression (storage method is- STORED), where each file is stored as a- .npyarray. See the C API documentation for more information on the format.
- metatensor.torch.load_labels(path: str) Labels[source]#
- Load previously saved - Labelsfrom the given file.