Unverified Commit 02571056 authored by Yanhui Liang's avatar Yanhui Liang Committed by GitHub
Browse files

Fix the hooks test comments (#4427)

parent d2d6ab4c
...@@ -32,14 +32,10 @@ tf.logging.set_verbosity(tf.logging.DEBUG) ...@@ -32,14 +32,10 @@ tf.logging.set_verbosity(tf.logging.DEBUG)
class ExamplesPerSecondHookTest(tf.test.TestCase): class ExamplesPerSecondHookTest(tf.test.TestCase):
"""Tests for the ExamplesPerSecondHook. """Tests for the ExamplesPerSecondHook.
In this test, we explicitly run global_step tensor after train_op in order to In the test, we explicitly run global_step tensor after train_op in order to
grab the correct global step value. This is to correct for discrepancies in keep the global_step value and the train_op (which increase the glboal_step
reported global step when running on GPUs. As in the after_run functions in by 1) consistent. This is to correct the discrepancies in reported global_step
ExamplesPerSecondHook, the global step from run_results value when running on GPUs.
(global_step = run_values.results) is not always correct and taken as the
stale global_step (which may be 1 off the correct value). The exact
global_step value should be from run_context
(global_step = run_context.session.run(global_step_tensor)
""" """
def setUp(self): def setUp(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment