ee8d44f96662f1bd264ef9119a8ad3305c50413c,sacred/randomness.py,,set_global_seed,#Any#,28

Before Change


    if module_is_in_cache("tensorflow"):
        import tensorflow as tf
        from packaging import version
        if version.parse(tf.__version__) < version.parse("2.0.0a0"):
            tf.set_random_seed(seed)
        else:
            tf.random.set_seed(seed)
    if module_is_in_cache("torch"):
        import torch
        torch.manual_seed(seed)
        if torch.cuda.is_available():

After Change


        opt.np.random.seed(seed)
    if module_is_in_cache("tensorflow"):
        // Ensures backward and forward compatibility with TensorFlow 1 and 2.
        if get_package_version("tensorflow") < parse_version("1.13.1"):
            import warnings
            warnings.warn("Use of TensorFlow 1.12 and older is deprecated. "
                          "Use Tensorflow 1.13 or newer instead.",
                          DeprecationWarning)
            import tensorflow as tf
        else:
            import tensorflow.compat.v1 as tf
        tf.set_random_seed(seed)
    if module_is_in_cache("torch"):
        import torch
        torch.manual_seed(seed)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: IDSIA/sacred
Commit Name: ee8d44f96662f1bd264ef9119a8ad3305c50413c
Time: 2019-04-21
Author: tarik@users.noreply.github.com
File Name: sacred/randomness.py
Class Name:
Method Name: set_global_seed


Project Name: MolSSI/QCEngine
Commit Name: f03ff5dcd9b09c807db6e76a2a821ff6602d26bf
Time: 2020-07-05
Author: farhadrgh@users.noreply.github.com
File Name: qcengine/programs/torchani.py
Class Name: TorchANIHarness
Method Name: get_model


Project Name: MolSSI/QCEngine
Commit Name: 0cb161f702bc90e34b38bbcc4223a710c15b835b
Time: 2019-03-25
Author: fangliu.ustc@gmail.com
File Name: qcengine/programs/terachem.py
Class Name: TeraChemExecutor
Method Name: compute


Project Name: tgsmith61591/pmdarima
Commit Name: d1afc2e7a6b505dd5c4b2142d99f05f1e480d5f5
Time: 2019-12-08
Author: drotarcharles@yahoo.com
File Name: pmdarima/compat/sklearn.py
Class Name:
Method Name: get_compatible_check_is_fitted