Miscellaneous

std::string metatensor_torch::version()

Get the version of metatensor_torch.

TensorMap Serialization

void metatensor_torch::save(const std::string &path, TorchTensorMap tensor)

Save the given TensorMap to a file at path

torch::Tensor metatensor_torch::save_buffer(TorchTensorMap tensor)

Save the given TensorMap to an in-memory buffer (represented as a torch::Tensor of bytes)

TorchTensorMap metatensor_torch::load(const std::string &path)

Load a previously saved TensorMap from the given path.

TorchTensorMap metatensor_torch::load_buffer(torch::Tensor buffer)

Load a previously saved TensorMap from the given in-memory buffer (represented as a torch::Tensor of bytes)

Labels Serialization

void metatensor_torch::save(const std::string &path, TorchLabels labels)

Save the given Labels to a file at path

torch::Tensor metatensor_torch::save_buffer(TorchLabels labels)

Save the given Labels to an in-memory buffer (represented as a torch::Tensor of bytes)

inline TorchLabels metatensor_torch::load_labels(const std::string &path)

Load previously saved Labels from the given path.

TorchLabels metatensor_torch::load_labels_buffer(torch::Tensor buffer)

Load previously saved Labels from the given in-memory buffer (represented as a torch::Tensor of bytes)