def make_deterministic(seed=0):
    "Make results deterministic. If seed == -1, do not make deterministic.\n        Running your script in a deterministic way might slow it down.\n        Note that for some packages (eg: sklearn's PCA) this function is not enough.\n    "
    seed = int(seed)
    if (seed == (- 1)):
        return
    random.seed(seed)
    np.random.seed(seed)
    torch.manual_seed(seed)
    torch.cuda.manual_seed_all(seed)
    torch.backends.cudnn.deterministic = True
    torch.backends.cudnn.benchmark = False
Make results deterministic. If seed == -1, do not make deterministic.
Running your script in a deterministic way might slow it down.
Note that for some packages (eg: sklearn's PCA) this function is not enough.
def make_deterministic(seed=0):
    "Make results deterministic. If seed == -1, do not make deterministic.\n        Running your script in a deterministic way might slow it down.\n        Note that for some packages (eg: sklearn's PCA) this function is not enough.\n    "
    seed = int(seed)
    if (seed == (- 1)):
        return
    random.seed(seed)
    np.random.seed(seed)
    torch.manual_seed(seed)
    torch.cuda.manual_seed_all(seed)
    torch.backends.cudnn.deterministic = True
    torch.backends.cudnn.benchmark = False