Skip to content
This repository was archived by the owner on Jul 7, 2023. It is now read-only.

Commit f2b620f

Browse files
author
Ryan Sepassi
committed
python3 fix to metrics_hook_test
PiperOrigin-RevId: 179886783
1 parent 83e5949 commit f2b620f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tensor2tensor/utils/metrics_hook.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,11 @@ def _process_metrics(self, global_step, metrics):
159159
if not metrics:
160160
return
161161

162-
if not metrics.values()[0]:
162+
if not list(metrics.values())[0]:
163163
return
164164

165165
# Metrics should have just a single subdir and a single tag
166-
steps, vals = metrics.values()[0][self._tags[0]]
166+
steps, vals = list(metrics.values())[0][self._tags[0]]
167167
return has_metric_plateaued(
168168
steps,
169169
vals,
@@ -224,11 +224,11 @@ def _after_run(self, run_context, run_values, global_step, metrics):
224224
if not metrics:
225225
return
226226

227-
if not metrics.values()[0]:
227+
if not list(metrics.values())[0]:
228228
return
229229

230230
# There should be only a single subdir and a single tag
231-
steps, vals = metrics.values()[0][self._tags[0]]
231+
steps, vals = list(metrics.values())[0][self._tags[0]]
232232

233233
if not steps:
234234
return

0 commit comments

Comments
 (0)