code: def on_load_checkpoint(self, checkpoint: Dict[str, Any]) -> None:
      # by default our models are initialized as float32. For other dtypes, we need to cast to the correct precision
      # before parameters are loaded by PyTorch-Lightning
      dtype = checkpoint["model_dtype"]
      self.to_dtype(dtype)
  
      # restoring attributes necessary to resume from training properly
      if (
          "loss_fn" in checkpoint.keys()
          and "torch_metrics_train" in checkpoint.keys()
      ):
          self.criterion = checkpoint["loss_fn"]
          self.train_metrics = checkpoint["torch_metrics_train"]
          self.val_metrics = checkpoint["torch_metrics_val"]
      else:
          # explicitly indicate to the user that there is a bug
          logger.warning(
              "This checkpoint was generated with darts <= 0.24.0, if a custom loss "
              "was used to train the model, it won't be properly loaded. Similarly, "
              "the torch metrics won't be restored from the checkpoint."
          )
  
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 19 for calling the PLForecastingModule obj's underlying member method code with example usage: obj.on_load_checkpoint(checkpoint) without return types