02ef279b852bad53771e02435d0caa0a64d17343,baseline/tf/classify/training/distributed.py,ClassifyTrainerDistributedTf,__init__,#ClassifyTrainerDistributedTf#Any#,36
Before Change
self.checkpoint_manager = tf.train.CheckpointManager(self._checkpoint,
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):
After Change
self.checkpoint_manager = tf.train.CheckpointManager(self._checkpoint,
directory=checkpoint_dir,
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):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 9
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: jsalt18-sentence-repl/jiant
Commit Name: 54f8206565767fc6cadf883fafc427345f97789d
Time: 2019-05-02
Author: wangalexc@gmail.com
File Name: main.py
Class Name:
Method Name: main
Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 8c18cecf15a8935d8bf712edcc91ac05daf2176e
Time: 2020-06-16
Author: tmatsuo@google.com
File Name: appengine/standard/noxfile-template.py
Class Name:
Method Name: