add manual seed

This commit is contained in:
Vladimir Mandic
2023-05-19 08:34:43 -04:00
parent df65e8e30a
commit 9033499e08
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -161,6 +161,8 @@ def cond_cast_float(tensor):
def randn(seed, shape):
torch.manual_seed(seed)
if shared.cmd_opts.use_ipex:
torch.xpu.manual_seed_all(seed)
if device.type == 'mps':
return torch.randn(shape, device=cpu).to(device)
return torch.randn(shape, device=device)