当前位置: 首页>>代码示例>>Python>>正文


Python tensorflow.lookup方法代码示例

本文整理汇总了Python中tensorflow.lookup方法的典型用法代码示例。如果您正苦于以下问题:Python tensorflow.lookup方法的具体用法?Python tensorflow.lookup怎么用?Python tensorflow.lookup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tensorflow的用法示例。


在下文中一共展示了tensorflow.lookup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import tensorflow [as 别名]
# 或者: from tensorflow import lookup [as 别名]
def __init__(self,
               tensor_key,
               table,
               shape_keys=None,
               shape=None,
               default_value=''):
    """Initializes the LookupTensor handler.

    Simply calls a vocabulary (most often, a label mapping) lookup.

    Args:
      tensor_key: the name of the `TFExample` feature to read the tensor from.
      table: A tf.lookup table.
      shape_keys: Optional name or list of names of the TF-Example feature in
        which the tensor shape is stored. If a list, then each corresponds to
        one dimension of the shape.
      shape: Optional output shape of the `Tensor`. If provided, the `Tensor` is
        reshaped accordingly.
      default_value: The value used when the `tensor_key` is not found in a
        particular `TFExample`.

    Raises:
      ValueError: if both `shape_keys` and `shape` are specified.
    """
    self._table = table
    super(LookupTensor, self).__init__(tensor_key, shape_keys, shape,
                                       default_value) 
开发者ID:cagbal,项目名称:ros_people_object_detection_tensorflow,代码行数:29,代码来源:tf_example_decoder.py

示例2: tensors_to_item

# 需要导入模块: import tensorflow [as 别名]
# 或者: from tensorflow import lookup [as 别名]
def tensors_to_item(self, keys_to_tensors):
    unmapped_tensor = super(LookupTensor, self).tensors_to_item(keys_to_tensors)
    return self._table.lookup(unmapped_tensor) 
开发者ID:cagbal,项目名称:ros_people_object_detection_tensorflow,代码行数:5,代码来源:tf_example_decoder.py


注:本文中的tensorflow.lookup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。