You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

util_init.py 229 B

1234567891011
  1. import numpy
  2. import torch
  3. import random
  4. def set_rng_seeds(seed):
  5. random.seed(seed)
  6. numpy.random.seed(seed)
  7. torch.random.manual_seed(seed)
  8. torch.cuda.manual_seed_all(seed)
  9. # print('RNG_SEED {}'.format(seed))