torch.xpu.seed#
- torch.xpu.seed()[source]#
将当前 GPU 随机数生成的种子设置为一个随机数。
If XPU is not available, calling this function is safe; it will be silently ignored.
警告
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()
.