contrib.layers.embedding_lookup_unique

tf.contrib.layers.embedding_lookup_unique

tf.contrib.layers.embedding_lookup_unique

embedding_lookup_unique(
    params,
    ids,
    name=None
)

Defined in tensorflow/contrib/layers/python/layers/embedding_ops.py.

Version of embedding_lookup that avoids duplicate lookups.

This can save communication in the case of repeated ids. Same interface as embedding_lookup. Except it supports multi-dimensional ids which allows to not reshape input/output to fit gather.

Args:

  • params: A list of tensors with the same shape and type, or a PartitionedVariable. Shape [index, d1, d2, ...].
  • ids: A one-dimensional Tensor with type int32 or int64 containing the ids to be looked up in params. Shape [ids1, ids2, ...].
  • name: A name for this operation (optional).

Returns:

A Tensor with the same type as the tensors in params and dimension of [ids1, ids2, d1, d2, ...].

Raises:

  • ValueError: If params is empty.

© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/contrib/layers/embedding_lookup_unique

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部