評價此頁

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.

返回型別

生成器