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


Python run_config._DEFAULT_UID_WHITE_LIST屬性代碼示例

本文整理匯總了Python中tensorflow.contrib.learn.python.learn.run_config._DEFAULT_UID_WHITE_LIST屬性的典型用法代碼示例。如果您正苦於以下問題:Python run_config._DEFAULT_UID_WHITE_LIST屬性的具體用法?Python run_config._DEFAULT_UID_WHITE_LIST怎麽用?Python run_config._DEFAULT_UID_WHITE_LIST使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在tensorflow.contrib.learn.python.learn.run_config的用法示例。


在下文中一共展示了run_config._DEFAULT_UID_WHITE_LIST屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: uid

# 需要導入模塊: from tensorflow.contrib.learn.python.learn import run_config [as 別名]
# 或者: from tensorflow.contrib.learn.python.learn.run_config import _DEFAULT_UID_WHITE_LIST [as 別名]
def uid(self, whitelist=None):
    """Generates a 'Unique Identifier' based on all internal fields.
    Caller should use the uid string to check `RunConfig` instance integrity
    in one session use, but should not rely on the implementation details, which
    is subject to change.
    Args:
      whitelist: A list of the string names of the properties uid should not
        include. If `None`, defaults to `_DEFAULT_UID_WHITE_LIST`, which
        includes most properties user allowes to change.
    Returns:
      A uid string.
    """
    if whitelist is None:
      whitelist = run_config._DEFAULT_UID_WHITE_LIST

    state = {k: v for k, v in self.__dict__.items() if not k.startswith('__')}
    # Pop out the keys in whitelist.
    for k in whitelist:
      state.pop('_' + k, None)

    ordered_state = collections.OrderedDict(
        sorted(state.items(), key=lambda t: t[0]))
    # For class instance without __repr__, some special cares are required.
    # Otherwise, the object address will be used.
    if '_cluster_spec' in ordered_state:
      ordered_state['_cluster_spec'] = collections.OrderedDict(
         sorted(ordered_state['_cluster_spec'].as_dict().items(),
                key=lambda t: t[0])
      )
    return ', '.join(
        '%s=%r' % (k, v) for (k, v) in six.iteritems(ordered_state)) 
開發者ID:rky0930,項目名稱:yolo_v2,代碼行數:33,代碼來源:cifar10_utils.py

示例2: uid

# 需要導入模塊: from tensorflow.contrib.learn.python.learn import run_config [as 別名]
# 或者: from tensorflow.contrib.learn.python.learn.run_config import _DEFAULT_UID_WHITE_LIST [as 別名]
def uid(self, whitelist=None):
    """Generates a 'Unique Identifier' based on all internal fields.
    Caller should use the uid string to check `RunConfig` instance integrity
    in one session use, but should not rely on the implementation details, which
    is subject to change.
    Args:
      whitelist: A list of the string names of the properties uid should not
        include. If `None`, defaults to `_DEFAULT_UID_WHITE_LIST`, which
        includes most properties user allowes to change.
    Returns:
      A uid string.
    """
    if whitelist is None:
      whitelist = run_config._DEFAULT_UID_WHITE_LIST

    state = {k: v for k, v in self.__dict__.items() if not k.startswith('__')}
    # Pop out the keys in whitelist.
    for k in whitelist:
      state.pop('_' + k, None)

    ordered_state = collections.OrderedDict(
        sorted(state.items(), key=lambda t: t[0]))
    # For class instance without __repr__, some special cares are required.
    # Otherwise, the object address will be used.
    if '_cluster_spec' in ordered_state:
      ordered_state['_cluster_spec'] = collections.OrderedDict(
          sorted(ordered_state['_cluster_spec'].as_dict().items(),
                 key=lambda t: t[0])
      )
    return ', '.join(
        '%s=%r' % (k, v) for (k, v) in six.iteritems(ordered_state)) 
開發者ID:richardaecn,項目名稱:class-balanced-loss,代碼行數:33,代碼來源:cifar_utils.py


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