當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。