GlobalRNGState#
- class torchrl.checkpoint.GlobalRNGState[source]#
Checkpointable process-global random-number-generator state.
The object captures Python, NumPy, Torch CPU, and initialized accelerator RNGs when
state_dict()is called.Examples
>>> import torch >>> from torchrl.checkpoint import GlobalRNGState >>> state = GlobalRNGState().state_dict() >>> "torch_cpu" in state True