class_docstr: Randomizer enables the program to be executed under a different seed within the context.
  
  Example:
  
  ```python
  randomizer = Randomizer(seed=1024)
  
  with randomizer.fork():
      # do something here with seed 1024
      do_something()
  ```
  
  Args:
      seed (int): The random seed to set.
      enable_cpu (bool): fork the CPU RNG state as well.
      with_index (bool): whether to use the index of the randomizer.
code: def __init__(self, seed: int):
      self.seed = seed
  
      # Handle device rng state
      # 1. get the current rng state
      # 2. set the seed and store the rng state
      # 3. recover the original rng state
      device_original_rng_state = get_rng_state()
      manual_seed(seed)
      self.device_rng_state = get_rng_state()
      set_rng_state(device_original_rng_state)
  
      # to the same for cpu rng state
      cpu_original_rng_state = torch.get_rng_state()
      torch.manual_seed(seed)
      self.cpu_rng_state = torch.get_rng_state()
      torch.set_rng_state(cpu_original_rng_state)
  
imports: from contextlib import contextmanager
  from typing import List
  import torch
  import torch.distributed
  from torch import nn
  from torch._utils import _flatten_dense_tensors, _unflatten_dense_tensors
  from torch.distributed import ProcessGroup, get_world_size
  from colossalai.utils.device import get_current_device, get_rng_state, set_rng_state, manual_seed
label_desc: Use image node_id 1 to create a new Randomizer object  with example: obj = Randomizer(seed)