SaveNNMixin

class SaveNNMixin[source]

Bases: etna.core.mixins.SaveMixin

Implementation of AbstractSaveable torch related classes.

It saves object to the zip archive with 2 files:

  • metadata.json: contains library version and class name.

  • object.pt: object saved by torch.save.

Inherited-members

Methods

load(path)

Load an object.

save(path)

Save the object.

classmethod load(path: pathlib.Path) typing_extensions.Self

Load an object.

Warning

This method uses dill module which is not secure. It is possible to construct malicious data which will execute arbitrary code during loading. Never load data that could have come from an untrusted source, or that could have been tampered with.

Parameters

path (pathlib.Path) – Path to load object from.

Returns

Loaded object.

Return type

typing_extensions.Self

save(path: pathlib.Path)

Save the object.

Parameters

path (pathlib.Path) – Path to save object to.