当前位置: 首页>>代码示例>>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;未经允许,请勿转载。