code: def _cast(value, dtype):
      if isinstance(value, torch.Tensor):
          is_eligible = (
              value.is_floating_point()
              and value.is_cuda
              and (value.dtype is not torch.float64)
          )
          return value.to(dtype) if is_eligible else value
      elif isinstance(value, (str, bytes)):
          return value
      elif HAS_NUMPY and isinstance(value, np.ndarray):
          return value
      elif isinstance(value, collections.abc.Mapping):
          return {
              _cast(k, dtype): _cast(v, dtype) for k, v in value.items()
          }
      elif isinstance(value, collections.abc.Iterable):
          iterable = (_cast(v, dtype) for v in value)
          if isinstance(value, (list, tuple)):
              return type(value)(iterable)
          else:
              return iterable
      else:
          return value
  
file_path: pytorch/torch/cuda/amp/autocast_mode.py
imports: import collections
  import functools
  import torch
  from typing import Any
label_desc: Use image node_id 1 for calling a global function with example usage: _cast(value, dtype) and returns: unknown, value, value, unknown, value, type, iterable