02ef279b852bad53771e02435d0caa0a64d17343,baseline/tf/classify/training/distributed.py,ClassifyTrainerDistributedTf,__init__,#ClassifyTrainerDistributedTf#Any#,36

Before Change


                                                             directory=checkpoint_dir,
                                                             max_to_keep=5)
        devices = ["/device:GPU:{}".format(i) for i in range(self.gpus)]
        self.strategy = tf.distribute.MirroredStrategy(devices)


    def _train(self, loader, steps=0, **kwargs):
        Train an epoch of data using either the input loader or using `tf.dataset`

After Change


                                                             max_to_keep=5)
        strategy_type = kwargs.get("strategy_type", "mirror")
        self.eval_device = kwargs.get("eval_device", "/device:GPU:0")
        if strategy_type == "tpu":
            self.eval_device = "/device:CPU:0"
            gpus = 0
        else:
            gpus = int(kwargs.get("gpus", 1))
        endpoint = kwargs.get("endpoint")
        self.strategy = create_distribute_strategy(strategy_type, gpus, endpoint)

    def reset_strategy_to_eval(self):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: dpressel/mead-baseline
Commit Name: 02ef279b852bad53771e02435d0caa0a64d17343
Time: 2020-09-02
Author: dpressel@gmail.com
File Name: baseline/tf/classify/training/distributed.py
Class Name: ClassifyTrainerDistributedTf
Method Name: __init__


Project Name: tensorflow/models
Commit Name: ece9941479124814158a58466b1c5a40a879eb27
Time: 2019-04-25
Author: ayushd@google.com
File Name: official/utils/misc/distribution_utils.py
Class Name:
Method Name: get_distribution_strategy


Project Name: tensorflow/models
Commit Name: 55d41fd67d7c08e9a88cc38f41f2b32089bde134
Time: 2020-09-10
Author: hongkuny@google.com
File Name: official/nlp/xlnet/run_pretrain.py
Class Name:
Method Name: main