code: def on_save_checkpoint(self, checkpoint: Dict[str, Any]) -> None:
      # we must save the dtype for correct parameter precision at loading time
      checkpoint["model_dtype"] = self.dtype
      # we must save the shape of the input to be able to instanciate the model without calling fit_from_dataset
      checkpoint["train_sample_shape"] = self.train_sample_shape
      # we must save the loss to properly restore it when resuming training
      checkpoint["loss_fn"] = self.criterion
      # we must save the metrics to continue outputing them when resuming training
      checkpoint["torch_metrics_train"] = self.train_metrics
      checkpoint["torch_metrics_val"] = self.val_metrics
  
imports: from abc import ABC, abstractmethod
  from functools import wraps
  from typing import Any, Dict, Optional, Sequence, Tuple, Union
  import pytorch_lightning
  import torch
  import torch.nn
  import torchmetrics
  from joblib import Parallel, delayed
  from darts.logging import get_logger, raise_if, raise_log
  from darts.models.components.layer_norm_variants import RINorm
  from darts.timeseries import TimeSeries
  from darts.utils.likelihood_models import Likelihood
  from darts.utils.timeseries_generation import _build_forecast_series
  from darts.utils.torch import MonteCarloDropout
label_desc: Use image node_id 18 for calling the PLForecastingModule obj's underlying member method code with example usage: obj.on_save_checkpoint(checkpoint) without return types