magail4autodrive: first commit

This commit is contained in:
ZHY
2025-09-28 18:57:04 +08:00
commit 947871a720
90 changed files with 1037 additions and 0 deletions

14
Env/utils.py Normal file
View File

@@ -0,0 +1,14 @@
import numpy as np
import torch
import random
def set_seed(seed):
if seed == -1:
seed = np.random.randint(0, 10000)
print('Random seed: {}'.format(seed))
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed(seed)
torch.cuda.manual_seed_all(seed)