W3cubDocs

/PyTorch 2.9

torch.xpu.manual_seed_all

torch.xpu.manual_seed_all(seed) [source]

Set the seed for generating random numbers on all GPUs.

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

Parameters

seed (int) – The desired seed.

© 2025, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://docs.pytorch.org/docs/2.9/generated/torch.xpu.manual_seed_all.html