code: def recursive_to_dtype(
      value: Union[Tuple, List, "torch.Tensor"],
      dtype: Optional[torch.dtype],
      start_dtype: Optional[torch.dtype] = None,
  ):
      if dtype is None:
          return value
  
      if isinstance(value, tuple):
          value = list(value)
          for i, val in enumerate(value):
              value[i] = recursive_to_dtype(val, dtype)
          value = tuple(value)
      elif isinstance(value, list):
          for i, val in enumerate(value):
              value[i] = recursive_to_dtype(val, dtype)
      elif isinstance(value, torch.Tensor):
          if start_dtype is None or (
              start_dtype is not None and value.dtype == start_dtype
          ):
              value = value.to(dtype=dtype)
  
      return value
  
imports: import copy
  from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Union
  import torch
  from packaging import version
  from transformers.models.speecht5.modeling_speecht5 import SpeechT5HifiGan
  from transformers.utils import is_tf_available, is_torch_available
  from ...utils import DIFFUSERS_MINIMUM_VERSION, ORT_QUANTIZE_MINIMUM_VERSION, check_if_diffusers_greater, is_diffusers_available, logging
  from ...utils.import_utils import _diffusers_version
  from ..tasks import TasksManager
  from .constants import ONNX_DECODER_NAME, ONNX_DECODER_WITH_PAST_NAME, ONNX_ENCODER_NAME
label_desc: Use image node_id 13 for calling a global function with example usage: recursive_to_dtype(value, dtype, start_dtype) and returns: value, value