class_docstr: Immutable dataclass that holds the state of the various random number generators.
class_docstr_tok: ["Immutable","dataclass","that","holds","the","state","of","the","various","random","number","generators","."]
docstr: Returns the current random state.
  
  NOTE: The `base_seed` of the returned object will be None.
docstr_tok: ["Returns","the","current","random","state",".","NOTE",":","The","`","base_seed","`","of","the","returned","object","will","be","None","."]
code: def current(cls) -> RandomState:
      """Returns the current random state.
  
      NOTE: The `base_seed` of the returned object will be None.
      """
      kwargs: dict[str, Any] = dict(
          random_state=random.getstate(),
          numpy_rng_state=np.random.get_state(),
      )
      if TORCH_INSTALLED:
          kwargs.update(
              torch_rng_state=torch.get_rng_state(),
              torch_cuda_rng_state=torch.cuda.get_rng_state_all(),
          )
      return cls(**kwargs)
  
file_path: orion/src/orion/core/utils/random_state.py
imports: from __future__ import annotations
  import random
  from contextlib import contextmanager
  from dataclasses import dataclass, replace
  from typing import Any, Protocol
  import numpy
label_desc: Use image node_id 1 for calling the RandomState obj's underlying member method code with example usage: obj.current(cls) and returns: cls