blob: c11ccb811f38045106b1e0ad42d141897d25890b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
import random
import numpy as np
def set_global_seeds(seed):
try:
import tensorflow as tf
except ImportError:
pass
else:
tf.set_random_seed(seed)
np.random.seed(seed)
random.seed(seed)
return
|