File size: 287 Bytes
da6a9a9
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
    """
    random.seed(seed)
    np.random.seed(seed)
    if is_torch_available():
        torch.manual_seed(seed)
        torch.cuda.manual_seed_all(seed)
        # ^^ safe to call this function even if cuda is not available
    if is_tf_available():
        tf.random.set_seed(seed)