def begin(self):
    self._last_reported_time = None
    self._last_reported_step = None
    self._global_step_tensor = contrib_variables.get_global_step()
    if (self._global_step_tensor is None):
        raise RuntimeError('Global step should be created to use StepCounterHook.')
def begin(self):
    self._last_reported_time = None
    self._last_reported_step = None
    self._global_step_tensor = contrib_variables.get_global_step()
    if (self._global_step_tensor is None):
        raise RuntimeError('Global step should be created to use StepCounterHook.')