(self, filename: str, device: torch.device = None)
return state
Loading a checkpoint

        Args:
            filename (str): the filename of a checkpoint
            device (torch.device): device where a checkpoint will be stored

        Returns:
            state (dict): a checkpoint
Loading a checkpoint
Loading a checkpoint
def load_checkpoint(self, filename: str, device: torch.device = None) -> dict:
        """Loading a checkpoint

        Args:
            filename (str): the filename of a checkpoint
            device (torch.device): device where a checkpoint will be stored

        Returns:
            state (dict): a checkpoint
        """
        device = device or (
            torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
        )
        state = torch.load(self._model_dir / filename, map_location=device)
        return state
def load_checkpoint ( self , filename : str , device : torch . device = None ) -> dict : device = device or ( torch . device ( "cuda" ) if torch . cuda . is_available ( ) else torch . device ( "cpu" ) ) state = torch . load ( self . _model_dir / filename , map_location = device ) return state