Rate this Page

Aliases in torch.xpu#

Created On: Sep 21, 2025 | Last Updated On: Feb 11, 2026

The following are aliases to their counterparts in torch.xpu in the nested namespaces in which they are defined. For any of these APIs, feel free to use the top-level version in torch.xpu like torch.xpu.seed or the nested version torch.xpu.random.seed.

get_rng_state

Return the random number generator state of the specified GPU as a ByteTensor.

get_rng_state_all

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

initial_seed

Return the current random seed of the current GPU.

manual_seed

Set the seed for generating random numbers for the current GPU.

manual_seed_all

Set the seed for generating random numbers on all GPUs.

seed

Set the seed for generating random numbers to a random number for the current GPU.

seed_all

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

set_rng_state

Set the random number generator state of the specified GPU.

set_rng_state_all

Set the random number generator state of all devices.

is_current_stream_capturing

Return True if XPU graph capture is underway on the current XPU stream, False otherwise.

graph_pool_handle

Return an opaque token representing the id of a graph memory pool.

XPUGraph

Wrapper around a XPU graph.

graph

Context-manager that captures XPU work into a torch.xpu.XPUGraph object for later replay.

make_graphed_callables

Accept callables (functions or nn.Modules) and returns graphed versions.

Event

Wrapper around a XPU event.

Stream

Wrapper around a XPU stream.