Functions 9
get_rng_state_all
functionFull reference ↗get_rng_state
functionFull reference ↗- tensorplay.cuda.random.get_rng_state(device: int | str | Any = 'cuda') TensorBase[source]
Return the random number generator state of the specified GPU as a ByteTensor.
- Parameters:
device (tensorplay.Device or int, optional) – The device to return the RNG state of. Default:
'cuda'(i.e., the current CUDA device).
Warning
This function eagerly initializes CUDA.
initial_seed
functionFull reference ↗manual_seed_all
functionFull reference ↗manual_seed
functionFull reference ↗- tensorplay.cuda.random.manual_seed(seed: int) None[source]
Set the seed for generating random numbers for the current GPU.
It’s safe to call this function if CUDA is not available; in that case, it is silently ignored.
- Parameters:
seed (int) – The desired seed.
Warning
If you are working with a multi-GPU model, this function is insufficient to get determinism. To seed all GPUs, use
manual_seed_all().
seed_all
functionFull reference ↗seed
functionFull reference ↗- tensorplay.cuda.random.seed() None[source]
Set the seed for generating random numbers to a random number for the current GPU.
It’s safe to call this function if CUDA is not available; in that case, it is silently ignored.
Warning
If you are working with a multi-GPU model, this function will only initialize the seed on one GPU. To initialize all GPUs, use
seed_all().
set_rng_state_all
functionFull reference ↗set_rng_state
functionFull reference ↗- tensorplay.cuda.random.set_rng_state(new_state: TensorBase, device: int | str | Any = 'cuda') None[source]
Set the random number generator state of the specified GPU.
- Parameters:
new_state (ByteTensor) – The desired state
device (tensorplay.Device or int, optional) – The device to set the RNG state. Default:
'cuda'(i.e., the current CUDA device).

