class_docstr: Random-state context manager class. Reference: https://github.com/luyug/GradCache.
  
  This class will back up the pytorch's random state during initialization. Then when the context is activated,
  the class will set up the random state with the backed-up one.
code: def __enter__(self):
      self._fork = torch.random.fork_rng(
          devices=self.fwd_gpu_devices, enabled=True
      )
      self._fork.__enter__()
      torch.set_rng_state(self.fwd_cpu_state)
      set_device_states(self.fwd_gpu_devices, self.fwd_gpu_states)
  
imports: from __future__ import annotations
  from contextlib import nullcontext
  from functools import partial
  import torch
  from torch import nn, Tensor
  from torch.utils.checkpoint import get_device_states, set_device_states
  from typing import Iterable, Dict, Iterator, List, Optional, Tuple
  from sentence_transformers import SentenceTransformer
  from sentence_transformers import util
  import tqdm
label_desc: Use image node_id 2 for calling the RandContext obj's underlying member method code with example usage: obj.__enter__() without return types