code: def convert_image_dtype(
      image: torch.Tensor, dtype: torch.dtype = torch.float
  ) -> torch.Tensor:
      """Convert a tensor image to the given ``dtype`` and scale the values accordingly
      This function does not support PIL Image.
  
      Args:
          image (torch.Tensor): Image to be converted
          dtype (torch.dtype): Desired data type of the output
  
      Returns:
          Tensor: Converted image
  
      .. note::
  
          When converting from a smaller to a larger integer ``dtype`` the maximum values are **not** mapped exactly.
          If converted back and forth, this mismatch has no effect.
  
      Raises:
          RuntimeError: When trying to cast :class:`torch.float32` to :class:`torch.int32` or :class:`torch.int64` as
              well as for trying to cast :class:`torch.float64` to :class:`torch.int64`. These conversions might lead to
              overflow errors since the floating point ``dtype`` cannot store consecutive integers over the whole range
              of the integer ``dtype``.
      """
      if not torch.jit.is_scripting() and not torch.jit.is_tracing():
          _log_api_usage_once(convert_image_dtype)
      if not isinstance(image, torch.Tensor):
          raise TypeError("Input img should be Tensor Image")
  
      return F_t.convert_image_dtype(image, dtype)
  
imports: import math
  import numbers
  import sys
  import warnings
  from enum import Enum
  from typing import Any, List, Optional, Tuple, Union
  import numpy
  import torch
  from PIL import Image
  from torch import Tensor
  from ..utils import _log_api_usage_once
  from .None import _functional_pil, _functional_tensor
label_desc: Use image node_id 9 for calling a global function with example usage: convert_image_dtype(image, dtype) and returns: F_t