code: def get_rng_state(
      device: Union[int, str, torch.device] = "cuda"
  ) -> Tensor:
      r"""Return the random number generator state of the specified GPU as a ByteTensor.
  
      Args:
          device (torch.device or int, optional): The device to return the RNG state of.
              Default: ``'cuda'`` (i.e., ``torch.device('cuda')``, the current CUDA device).
  
      .. warning::
          This function eagerly initializes CUDA.
      """
      _lazy_init()
      if isinstance(device, str):
          device = torch.device(device)
      elif isinstance(device, int):
          device = torch.device("cuda", device)
      idx = device.index
      if idx is None:
          idx = current_device()
      default_generator = torch.cuda.default_generators[idx]
      return default_generator.get_state()
  
file_path: pytorch/torch/cuda/random.py
imports: from typing import Iterable, List, Union
  import torch
  from ..None import Tensor
  from .None import _lazy_call, _lazy_init, current_device, device_count
label_desc: Use image node_id 1 for calling a global function with example usage: get_rng_state(device) and returns: default_generator