code: def _is_supported_device(tensor: torch.Tensor) -> bool:
      return tensor.is_cuda or tensor.device.type in ("xla", "cpu")
  
imports: import logging
  from collections import abc, defaultdict
  from typing import Any, Dict, Iterable, List, Optional, overload, Sequence, Tuple, Union
  import torch
  import torch.distributed
  from torch.cuda.amp.grad_scaler import _MultiDeviceReplicator, GradScaler, OptState
  from torch.distributed.distributed_c10d import ProcessGroup
label_desc: Use image node_id 2 for calling a global function with example usage: _is_supported_device(tensor) and returns: unknown