评价此页

torch.manual_seed#

torch.manual_seed(seed)[源代码]#

设置所有设备的随机数生成种子。返回一个 torch.Generator 对象。

参数

seed (int) – The desired seed. Value must be within the inclusive range [-0x8000_0000_0000_0000, 0xffff_ffff_ffff_ffff]. Otherwise, a RuntimeError is raised. Negative inputs are remapped to positive values with the formula 0xffff_ffff_ffff_ffff + seed.

返回类型

生成器