252e63849b5cf8dd12d6930dc2e9f8c51ea70251,official/nlp/bert/run_squad.py,,main,#Any#,378
Before Change
return
strategy = None
if FLAGS.strategy_type == "mirror":
strategy = tf.distribute.MirroredStrategy()
elif FLAGS.strategy_type == "multi_worker_mirror":
strategy = tf.distribute.experimental.MultiWorkerMirroredStrategy()
elif FLAGS.strategy_type == "tpu":
cluster_resolver = tpu_lib.tpu_initialize(FLAGS.tpu)
strategy = tf.distribute.experimental.TPUStrategy(cluster_resolver)
else:
raise ValueError("The distribution strategy type is not supported: %s" %
FLAGS.strategy_type)
if FLAGS.mode in ("train", "train_and_predict"):
train_squad(strategy, input_meta_data)
if FLAGS.mode in ("predict", "train_and_predict"):
predict_squad(strategy, input_meta_data)
After Change
export_squad(FLAGS.model_export_path, input_meta_data)
return
strategy = distribution_utils.get_distribution_strategy(
distribution_strategy=FLAGS.distribution_strategy,
num_gpus=FLAGS.num_gpus,
tpu_address=FLAGS.tpu)
if FLAGS.mode in ("train", "train_and_predict"):
train_squad(strategy, input_meta_data)
if FLAGS.mode in ("predict", "train_and_predict"):
predict_squad(strategy, input_meta_data)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 25
Instances
Project Name: tensorflow/models
Commit Name: 252e63849b5cf8dd12d6930dc2e9f8c51ea70251
Time: 2019-11-19
Author: hongkuny@google.com
File Name: official/nlp/bert/run_squad.py
Class Name:
Method Name: main
Project Name: tensorflow/models
Commit Name: 252e63849b5cf8dd12d6930dc2e9f8c51ea70251
Time: 2019-11-19
Author: hongkuny@google.com
File Name: official/nlp/bert/run_classifier.py
Class Name:
Method Name: main
Project Name: tensorflow/models
Commit Name: 252e63849b5cf8dd12d6930dc2e9f8c51ea70251
Time: 2019-11-19
Author: hongkuny@google.com
File Name: official/nlp/bert/run_squad.py
Class Name:
Method Name: main
Project Name: tensorflow/models
Commit Name: 252e63849b5cf8dd12d6930dc2e9f8c51ea70251
Time: 2019-11-19
Author: hongkuny@google.com
File Name: official/nlp/bert/run_pretraining.py
Class Name:
Method Name: main