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: Sets the random state using the values in `self`.
docstr_tok: ["Sets","the","random","state","using","the","values","in","`","self","`","."]
code: def set(self) -> None:
      """Sets the random state using the values in `self`."""
      random.setstate(self.random_state)
      np.random.set_state(self.numpy_rng_state)
      if TORCH_INSTALLED:
          torch.random.set_rng_state(self.torch_rng_state)
          torch.cuda.set_rng_state_all(self.torch_cuda_rng_state)
  
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 2 for calling the RandomState obj's underlying member method code with example usage: obj.set() without return types