Source code for mtrl.utils.checkpointable

# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""Interface for the objects that can be checkpointed on the filesystem."""
from abc import ABC, abstractmethod
from typing import Any


[docs]class Checkpointable(ABC): """All classes that want to support checkpointing should extend this class."""
[docs] @abstractmethod def save(self, *args, **kwargs) -> Any: """Save the object to a checkpoint. Returns: Any """ pass
[docs] @abstractmethod def load(self, *args, **kwargs) -> Any: """Load the object from a checkpoint. Returns: Any """ pass