本文整理汇总了Python中tensorflow.python.pywrap_tensorflow.TF_Reset方法的典型用法代码示例。如果您正苦于以下问题:Python pywrap_tensorflow.TF_Reset方法的具体用法?Python pywrap_tensorflow.TF_Reset怎么用?Python pywrap_tensorflow.TF_Reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tensorflow.python.pywrap_tensorflow
的用法示例。
在下文中一共展示了pywrap_tensorflow.TF_Reset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: reset
# 需要导入模块: from tensorflow.python import pywrap_tensorflow [as 别名]
# 或者: from tensorflow.python.pywrap_tensorflow import TF_Reset [as 别名]
def reset(target, containers=None, config=None):
"""Resets resource containers on `target`, and close all connected sessions.
A resource container is distributed across all workers in the
same cluster as `target`. When a resource container on `target`
is reset, resources associated with that container will be cleared.
In particular, all Variables in the container will become undefined:
they lose their values and shapes.
NOTE:
(i) reset() is currently only implemented for distributed sessions.
(ii) Any sessions on the master named by `target` will be closed.
If no resource containers are provided, all containers are reset.
Args:
target: The execution engine to connect to.
containers: A list of resource container name strings, or `None` if all of
all the containers are to be reset.
config: (Optional.) Protocol buffer with configuration options.
Raises:
tf.errors.OpError: Or one of its subclasses if an error occurs while
resetting containers.
"""
if target is not None:
target = compat.as_bytes(target)
if containers is not None:
containers = [compat.as_bytes(c) for c in containers]
else:
containers = []
tf_session.TF_Reset(target, containers, config)