Exemple #1
0
def stop_recording():
  """Stop all gradient recording (backprop and forwardprop)."""
  is_stopped = pywrap_tensorflow.TFE_Py_TapeSetIsStopped()
  try:
    if not is_stopped:
      pywrap_tensorflow.TFE_Py_TapeSetStopOnThread()
    yield
  finally:
    if not is_stopped:
      pywrap_tensorflow.TFE_Py_TapeSetRestartOnThread()
Exemple #2
0
def stop_recording():
    try:
        pywrap_tensorflow.TFE_Py_TapeSetStopOnThread()
        yield
    finally:
        pywrap_tensorflow.TFE_Py_TapeSetRestartOnThread()