# tensorplay.cuda.random.set_rng_state

Source: https://www.tensorplay.cn/docs/generated/tensorplay.cuda.random.set_rng_state.html

# tensorplay.cuda.random.set_rng_state

tensorplay.cuda.random.set_rng_state(new_state: TensorBase, device: [int](https://docs.python.org/3/library/functions.html#int) | [str](https://docs.python.org/3/library/stdtypes.html#str) | [Any](https://docs.python.org/3/library/typing.html#typing.Any) = 'cuda') &#x2192; [None](https://docs.python.org/3/library/constants.html#None)[[source]](../_modules/tensorplay/cuda/random.html#set_rng_state)

Set the random number generator state of the specified GPU.

Parameters:

- new_state ( ByteTensor ) – The desired state

- device ([tensorplay.Device](tensorplay.Device.html#tensorplay.Device) or [int](https://docs.python.org/3/library/functions.html#int) , optional ) – The device to set the RNG state. Default: 'cuda' (i.e., the current CUDA device).
