set_state#
- delu.random.set_state(state: Dict[str, Any], /, cuda: bool = True) None [source]#
Set the global RNG states in
random
,numpy
andtorch
.Usage
See
delu.random.get_state
for usage examples.- Parameters:
state – the dict with the states produced by
delu.random.get_state
. If the'torch.cuda'
key is presented instate
, then it must be a list of the size equal to the device count as reported bytorch.cuda.device_count
. If'torch.cuda'
is not presented instate
, the state of the CUDA global RNGs is not set.