TensorPlay
latest (dev)
Copy
View Markdown

Latest development documentation · Updated 2026-10-08

tensorplay.accelerator.random

Device-agnostic random-number helpers for the current accelerator.

Seeds and generator states are read and written through the active accelerator backend (the GPU backend in this build). device accepts a device object, a spelling such as "cuda:1", an integer index, or None for the current device.

Functions

get_rng_state([device])

Generator state of the given accelerator device.

get_rng_state_all()

Generator states of every accelerator device.

initial_seed([device])

Initial seed of the generator for the given accelerator device.

manual_seed(seed)

Seed the generator of the current accelerator device.

manual_seed_all(seed)

Seed the generators of every accelerator device.

seed()

Reseed the generator of the current accelerator device.

seed_all()

Reseed the generators of every accelerator device.

set_rng_state(new_state[, device])

Set the generator state of the given accelerator device.

set_rng_state_all(new_states)

Set the generator states of every accelerator device.

Ask DeepWiki