0270cac779f61a879f74d9495b9156f8f4127478,official/utils/logs/logger.py,BenchmarkFileLogger,log_metric,#BenchmarkFileLogger#Any#Any#Any#Any#Any#,126

Before Change



    with tf.gfile.GFile(
        os.path.join(self._logging_dir, METRIC_LOG_FILE_NAME), "a") as f:
      metric = {
          "name": name,
          "value": float(value),
          "unit": unit,
          "global_step": global_step,
          "timestamp": datetime.datetime.utcnow().strftime(
              _DATE_TIME_FORMAT_PATTERN),
          "extras": extras}
      try:
        json.dump(metric, f)
        f.write("\n")
      except (TypeError, ValueError) as e:

After Change


      global_step: int, the global_step when the metric is logged.
      extras: map of string:string, the extra information about the metric.
    
    metric = _process_metric_to_json(name, value, unit, global_step, extras)
    if metric:
      with tf.gfile.GFile(
          os.path.join(self._logging_dir, METRIC_LOG_FILE_NAME), "a") as f:
        try:
          json.dump(metric, f)
          f.write("\n")
        except (TypeError, ValueError) as e:
          tf.logging.warning("Failed to dump metric to log file: "
                             "name %s, value %s, error %s", name, value, e)

  def log_run_info(self, model_name, dataset_name, run_params):
    Collect most of the TF runtime information for the local env.

    The schema of the run info follows official/benchmark/datastore/schema.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: tensorflow/models
Commit Name: 0270cac779f61a879f74d9495b9156f8f4127478
Time: 2018-05-11
Author: scottzhu@google.com
File Name: official/utils/logs/logger.py
Class Name: BenchmarkFileLogger
Method Name: log_metric


Project Name: comic/grand-challenge.org
Commit Name: f8f5eb96468aa94acad1c085fc9a8c80d7b6db8f
Time: 2017-11-15
Author: pkcakeout@gmail.com
File Name: app/evaluation/widgets/uploader.py
Class Name: AjaxUploadWidget
Method Name: handle_ajax


Project Name: okfn-brasil/serenata-de-amor
Commit Name: 3baf62ba607a95dcb0d5971594389d3586286ef6
Time: 2016-12-06
Author: andresouzapinho@gmail.com
File Name: src/fetch_foursquare_info.py
Class Name:
Method Name:


Project Name: home-assistant/home-assistant
Commit Name: 0c0feda83426ce807d69bbd0f51085e07aad10b9
Time: 2016-09-25
Author: paulus@paulusschoutsen.nl
File Name: homeassistant/helpers/template.py
Class Name:
Method Name: render