code: def get_torch_device():
      if torch.cuda.is_available():
          return "cuda"
  
      if bool(os.environ.get("LUDWIG_ENABLE_MPS")):
          if (
              torch.backends.mps.is_available()
              and torch.backends.mps.is_built()
          ):
              if not bool(
                  os.environ.get("PYTORCH_ENABLE_MPS_FALLBACK")
              ):
                  warnings.warn(
                      "LUDWIG_ENABLE_MPS is set and MPS is available, but PYTORCH_ENABLE_MPS_FALLBACK has not been set. "
                      "Depending on your model config, some operations may not be compatible. If errors occur, try "
                      "setting `PYTORCH_ENABLE_MPS_FALLBACK=1` and resubmitting."
                  )
              return "mps"
          else:
              warnings.warn(
                  "LUDWIG_ENABLE_MPS is set but MPS is not available, falling back to CPU."
              )
  
      return "cpu"
  
imports: import math
  import os
  import warnings
  from abc import abstractmethod
  from functools import lru_cache
  from typing import List, Optional, Tuple, Union
  import torch
  from torch import nn
  from torch.nn import Module, ModuleDict
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.constants import ENCODER_OUTPUT
  from ludwig.utils.strings_utils import SpecialSymbol
label_desc: Use image node_id 1 for calling a global function with example usage: get_torch_device() and returns: str, str, str