code: def _maybe_convert_to_dtype(a, dtype):
      if isinstance(a, TensorLike):
          if a.dtype != dtype:
              return a.to(dtype)
          return a
      if isinstance(a, Number):
          return utils.dtype_to_type_ctor(dtype)(a)  # type: ignore[arg-type]
      if isinstance(a, Sequence):
          return tuple(_maybe_convert_to_dtype(x, dtype) for x in a)
      # Passthrough None because some functions wrapped with type promotion
      # wrapper might have optional args
      if a is None:
          return None
  
      raise ValueError(
          f"Received type {type(a)} that is neither a tensor or a number!"
      )
  
imports: import inspect
  import warnings
  from functools import wraps
  from itertools import chain
  from typing import Callable, NamedTuple, Optional, overload, Sequence, Tuple
  import torch
  import torch._prims_common
  from torch._prims_common import CustomOutParamAnnotation, ELEMENTWISE_TYPE_PROMOTION_KIND, Number, NumberType, ShapeType, TensorLike, TensorLikeType
  from torch.utils import _pytree
  from torch.utils._pytree import tree_flatten, tree_unflatten
label_desc: Use image node_id 5 for calling a global function with example usage: _maybe_convert_to_dtype(a, dtype) and returns: a, utils, tuple, None, a