docstr: Cast module precision (float32 by default) to another precision.
docstr_tok: ["Cast","module","precision","(","float32","by","default",")","to","another","precision","."]
code: def to_dtype(self, dtype):
      """Cast module precision (float32 by default) to another precision."""
      if dtype == torch.float16:
          self.half()
      if dtype == torch.float32:
          self.float()
      elif dtype == torch.float64:
          self.double()
      else:
          raise_if(
              True,
              f"Trying to load dtype {dtype}. Loading for this type is not implemented yet. Please report this "
              f"issue on https://github.com/unit8co/darts",
              logger,
          )
  
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 20 for calling the PLForecastingModule obj's underlying member method code with example usage: obj.to_dtype(dtype) without return types