code: def _extract_device_dtype(
      tensor_list: List[Optional[Any]],
  ) -> Tuple[torch.device, torch.dtype]:
      """Check if all the input are in the same device (only if when they are Tensor).
  
      If so, it would return a tuple of (device, dtype). Default: (cpu, ``get_default_dtype()``).
  
      Returns:
          [torch.device, torch.dtype]
      """
      device, dtype = None, None
      for tensor in tensor_list:
          if tensor is not None:
              if not isinstance(tensor, (Tensor,)):
                  continue
              _device = tensor.device
              _dtype = tensor.dtype
              if device is None and dtype is None:
                  device = _device
                  dtype = _dtype
              elif device != _device or dtype != _dtype:
                  raise ValueError(
                      "Passed values are not in the same device and dtype."
                      f"Got ({device}, {dtype}) and ({_device}, {_dtype})."
                  )
      if device is None:
          # TODO: update this when having torch.get_default_device()
          device = torch.device("cpu")
      if dtype is None:
          dtype = torch.get_default_dtype()
      return (device, dtype)
  
imports: import platform
  import sys
  import warnings
  from functools import wraps
  from inspect import isclass, isfunction
  from typing import TYPE_CHECKING, Any, Callable, List, Optional, Tuple, Union, overload
  import torch
  from torch.linalg import inv_ex
  from kornia.core import Tensor
  from kornia.utils._compat import torch_version_ge
label_desc: Use image node_id 8 for calling a global function with example usage: _extract_device_dtype(tensor_list) and returns: device,  dtype