docstr: process the torch_metrics parameter.
docstr_tok: ["process","the","torch_metrics","parameter","."]
code: def configure_torch_metrics(
      torch_metrics: Union[
          torchmetrics.Metric, torchmetrics.MetricCollection
      ]
  ) -> torchmetrics.MetricCollection:
      """process the torch_metrics parameter."""
      if torch_metrics is None:
          torch_metrics = torchmetrics.MetricCollection([])
      elif isinstance(torch_metrics, torchmetrics.Metric):
          torch_metrics = torchmetrics.MetricCollection([torch_metrics])
      elif isinstance(torch_metrics, torchmetrics.MetricCollection):
          pass
      else:
          raise_log(
              AttributeError(
                  "`torch_metrics` only accepts type torchmetrics.Metric or torchmetrics.MetricCollection"
              ),
              logger,
          )
      return torch_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 23 for calling the PLForecastingModule obj's underlying member method code with example usage: obj.configure_torch_metrics(torch_metrics) and returns: torch_metrics