diff options
author | Anna R <annarev@google.com> | 2017-05-17 14:28:12 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-05-17 14:32:35 -0700 |
commit | 1e631f82a490d4596cdbbf6f3b7a3ec3abcfb56f (patch) | |
tree | 89a4b969c0b7de8e790e67073b5b941d6372a532 /tensorflow/python/platform | |
parent | 157370e5916b85c65958ed8383ae31d727228ed7 (diff) |
Print benchmark output if reporting is not requested.
PiperOrigin-RevId: 156354145
Diffstat (limited to 'tensorflow/python/platform')
-rw-r--r-- | tensorflow/python/platform/benchmark.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tensorflow/python/platform/benchmark.py b/tensorflow/python/platform/benchmark.py index aa74a419d8..bd2ef36170 100644 --- a/tensorflow/python/platform/benchmark.py +++ b/tensorflow/python/platform/benchmark.py @@ -73,11 +73,6 @@ def _global_report_benchmark( cpu_time is not None else -1, throughput if throughput is not None else -1, str(extras) if extras else "") - test_env = os.environ.get(TEST_REPORTER_TEST_ENV, None) - if test_env is None: - # Reporting was not requested - return - entries = test_log_pb2.BenchmarkEntries() entry = entries.entry.add() entry.name = name @@ -96,6 +91,12 @@ def _global_report_benchmark( else: entry.extras[k].string_value = str(v) + test_env = os.environ.get(TEST_REPORTER_TEST_ENV, None) + if test_env is None: + # Reporting was not requested, just print the proto + print(str(entries)) + return + serialized_entry = entries.SerializeToString() mangled_name = name.replace("/", "__") |