mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-25 19:48:11 +00:00
ORTModule set_seed in int (#8511)
This commit is contained in:
parent
7d47175f76
commit
686f9b530b
1 changed files with 2 additions and 2 deletions
|
|
@ -51,13 +51,13 @@ set_seed((torch.initial_seed() % sys.maxsize))
|
|||
|
||||
# Override torch.manual_seed and torch.cuda.manual_seed
|
||||
def override_torch_manual_seed(seed):
|
||||
set_seed(seed % sys.maxsize)
|
||||
set_seed(int(seed % sys.maxsize))
|
||||
return torch_manual_seed(seed)
|
||||
torch_manual_seed = torch.manual_seed
|
||||
torch.manual_seed = override_torch_manual_seed
|
||||
|
||||
def override_torch_cuda_manual_seed(seed):
|
||||
set_seed(seed % sys.maxsize)
|
||||
set_seed(int(seed % sys.maxsize))
|
||||
return torch_cuda_manual_seed(seed)
|
||||
torch_cuda_manual_seed = torch.cuda.manual_seed
|
||||
torch.cuda.manual_seed = override_torch_cuda_manual_seed
|
||||
|
|
|
|||
Loading…
Reference in a new issue