TensorPlay

Latest development documentation · Updated 2026-09-08. A documentation snapshot for package 1.0.0.dev20260909 is not available.

On this page

Functions 9

#

get_rng_state_all

functionFull reference ↗
tensorplay.cuda.random.get_rng_state_all() list[TensorBase][source]

Return a list of ByteTensor representing the random number states of all devices.

#

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 ↗
tensorplay.cuda.random.initial_seed() int[source]

Return the current random seed of the current GPU.

Warning

This function eagerly initializes CUDA.

#

manual_seed_all

functionFull reference ↗
tensorplay.cuda.random.manual_seed_all(seed: int) None[source]

Set the seed for generating random numbers on all GPUs.

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.

#

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 ↗
tensorplay.cuda.random.seed_all() None[source]

Set the seed for generating random numbers to a random number on all GPUs.

It’s safe to call this function if CUDA is not available; in that case, it is silently ignored.

#

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 ↗
tensorplay.cuda.random.set_rng_state_all(new_states: Iterable[TensorBase]) None[source]

Set the random number generator state of all devices.

Parameters:

new_states (Iterable of ByteTensor) – The desired state for each device.

#

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).

Search documentation

Search all 1,743 documentation pages.

Keyboard shortcuts

Global

  • /Focus search
  • ?This dialog
  • ,Open settings
  • jAI assistant

Search

  • Navigate results
  • Open result
  • escClose

Package

  • mMain information
  • dDocs
  • .Code
  • -Changelog
  • tTimeline
  • sStats
  • vVersions