Skip to content

Commit 1e631f8

Browse files
annarevtensorflower-gardener
authored andcommitted
Print benchmark output if reporting is not requested.
PiperOrigin-RevId: 156354145
1 parent 157370e commit 1e631f8

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

tensorflow/python/platform/benchmark.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,6 @@ def _global_report_benchmark(
7373
cpu_time is not None else -1, throughput if
7474
throughput is not None else -1, str(extras) if extras else "")
7575

76-
test_env = os.environ.get(TEST_REPORTER_TEST_ENV, None)
77-
if test_env is None:
78-
# Reporting was not requested
79-
return
80-
8176
entries = test_log_pb2.BenchmarkEntries()
8277
entry = entries.entry.add()
8378
entry.name = name
@@ -96,6 +91,12 @@ def _global_report_benchmark(
9691
else:
9792
entry.extras[k].string_value = str(v)
9893

94+
test_env = os.environ.get(TEST_REPORTER_TEST_ENV, None)
95+
if test_env is None:
96+
# Reporting was not requested, just print the proto
97+
print(str(entries))
98+
return
99+
99100
serialized_entry = entries.SerializeToString()
100101

101102
mangled_name = name.replace("/", "__")

0 commit comments

Comments
 (0)