本文整理匯總了Python中tensorflow.python.training.basic_session_run_hooks.SessionRunArgs方法的典型用法代碼示例。如果您正苦於以下問題:Python basic_session_run_hooks.SessionRunArgs方法的具體用法?Python basic_session_run_hooks.SessionRunArgs怎麽用?Python basic_session_run_hooks.SessionRunArgs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類tensorflow.python.training.basic_session_run_hooks
的用法示例。
在下文中一共展示了basic_session_run_hooks.SessionRunArgs方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: after_run
# 需要導入模塊: from tensorflow.python.training import basic_session_run_hooks [as 別名]
# 或者: from tensorflow.python.training.basic_session_run_hooks import SessionRunArgs [as 別名]
def after_run(self, run_context, run_values):
# Global step cannot be retrieved via SessionRunArgs and before_run due to
# race condition.
global_step = run_context.session.run(self._global_step_tensor)
if global_step >= self._last_step:
run_context.request_stop()
else:
iterations = self._next_iterations(global_step, self._last_step)
self._iterations_per_loop_var.load(
iterations, session=run_context.session)
示例2: before_run
# 需要導入模塊: from tensorflow.python.training import basic_session_run_hooks [as 別名]
# 或者: from tensorflow.python.training.basic_session_run_hooks import SessionRunArgs [as 別名]
def before_run(self, run_context):
return session_run_hook.SessionRunArgs(self._scalar_stopping_signal)
示例3: before_run
# 需要導入模塊: from tensorflow.python.training import basic_session_run_hooks [as 別名]
# 或者: from tensorflow.python.training.basic_session_run_hooks import SessionRunArgs [as 別名]
def before_run(self, run_context): # pylint: disable=unused-argument
return basic_session_run_hooks.SessionRunArgs(self._global_step_tensor)
示例4: before_run
# 需要導入模塊: from tensorflow.python.training import basic_session_run_hooks [as 別名]
# 或者: from tensorflow.python.training.basic_session_run_hooks import SessionRunArgs [as 別名]
def before_run(self, run_context): # pylint: disable=unused-argument
return basic_session_run_hooks.SessionRunArgs(self._global_step_tensor)