zero.random.set_state

zero.random.set_state(state)[source]

Set global random states in random, numpy and torch.

Parameters

state (Dict[str, Any]) – global RNG states. Must be produced by get_state. The size of the list state['torch.cuda'] must be equal to the number of available cuda devices.

Return type

None

See also

get_state

Raises

AssertionError – if torch.cuda.device_count() != len(state['torch.cuda'])

Parameters

state (Dict[str, Any]) –

Return type

None