code: def manual_seed(seed) -> torch._C.Generator:
      r"""Sets the seed for generating random numbers. Returns a
      `torch.Generator` object.
  
      Args:
          seed (int): The desired seed. Value must be within the inclusive range
              `[-0x8000_0000_0000_0000, 0xffff_ffff_ffff_ffff]`. Otherwise, a RuntimeError
              is raised. Negative inputs are remapped to positive values with the formula
              `0xffff_ffff_ffff_ffff + seed`.
      """
      seed = int(seed)
      import torch.cuda
  
      if not torch.cuda._is_in_bad_fork():
          torch.cuda.manual_seed_all(seed)
  
      import torch.mps
  
      if not torch.mps._is_in_bad_fork():
          torch.mps.manual_seed(seed)
  
      if hasattr(torch, "xpu") and not torch.xpu._is_in_bad_fork():
          torch.xpu.manual_seed_all(seed)
  
      _seed_custom_device(seed)
  
      return default_generator.manual_seed(seed)
  
file_path: pytorch/torch/random.py
imports: import contextlib
  from typing import Generator
  import warnings
  from torch._C import default_generator
  import torch
label_desc: Use image node_id 3 for calling a global function with example usage: manual_seed(seed) and returns: default_generator