def set_rng_seed(rng_seed):
"""
Sets seeds of torch, numpy, and torch.cuda (if available).
:param int rng_seed: The seed value.
"""
torch.manual_seed(rng_seed)
if torch.cuda.is_available():
torch.cuda.manual_seed_all(rng_seed)
np.random.seed(rng_seed)
评论列表
文章目录