當前位置: 首頁>>代碼示例>>Python>>正文


Python pywrap_tensorflow.TF_Reset方法代碼示例

本文整理匯總了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) 
開發者ID:ryfeus,項目名稱:lambda-packs,代碼行數:34,代碼來源:session.py


注:本文中的tensorflow.python.pywrap_tensorflow.TF_Reset方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。