tf.raw_ops.EnqueueTPUEmbeddingRaggedTensorBatch
Stay organized with collections
Save and categorize content based on your preferences.
Eases the porting of code that uses tf.nn.embedding_lookup().
tf.raw_ops.EnqueueTPUEmbeddingRaggedTensorBatch(
sample_splits,
embedding_indices,
aggregation_weights,
mode_override,
table_ids,
device_ordinal=-1,
combiners=[],
max_sequence_lengths=[],
num_features=[],
name=None
)
sample_splits[i], embedding_indices[i] and aggregation_weights[i] correspond
to the ith feature. table_ids[i] indicates which embedding table to look up ith
feature.
The tensors at corresponding positions in two of the input lists,
embedding_indices and aggregation_weights, must have the same shape, i.e. rank 1
with dim_size() equal to the total number of lookups into the table described by
the corresponding feature.
Args |
sample_splits
|
A list of at least 1 Tensor objects with the same type in: int32 , int64 .
A list of rank 1 Tensors specifying the break points for splitting
embedding_indices and aggregation_weights into rows.
It corresponds to ids.row_splits in embedding_lookup(), when ids is a
RaggedTensor.
|
embedding_indices
|
A list with the same length as sample_splits of Tensor objects with the same type in: int32 , int64 .
A list of rank 1 Tensors, indices into the embedding tables.
It corresponds to ids.values in embedding_lookup(), when ids is a RaggedTensor.
|
aggregation_weights
|
A list with the same length as sample_splits of Tensor objects with the same type in: float32 , float64 .
A list of rank 1 Tensors containing per training example
aggregation weights. It corresponds to the values field of a RaggedTensor
with the same row_splits as ids in embedding_lookup(), when ids is a
RaggedTensor.
|
mode_override
|
A Tensor of type string .
A string input that overrides the mode specified in the
TPUEmbeddingConfiguration. Supported values are {'unspecified', 'inference',
'training', 'backward_pass_only'}. When set to 'unspecified', the mode set
in TPUEmbeddingConfiguration is used, otherwise mode_override is used.
|
table_ids
|
A list of ints .
A list of integers specifying the identifier of the embedding table
(offset of TableDescriptor in the TPUEmbeddingConfiguration) to lookup the
corresponding input. The ith input is looked up using table_ids[i]. The size
of the table_ids list must be equal to that of sample_indices,
embedding_indices and aggregation_weights.
|
device_ordinal
|
An optional int . Defaults to -1 .
The TPU device to use. Should be >= 0 and less than the number
of TPU cores in the task on which the node is placed.
|
combiners
|
An optional list of strings . Defaults to [] .
A list of string scalars, one for each embedding table that specify
how to normalize the embedding activations after weighted summation.
Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have
the sum of the weights be 0 for 'mean' or the sum of the squared weights be
0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for
all tables.
|
max_sequence_lengths
|
An optional list of ints . Defaults to [] .
|
num_features
|
An optional list of ints . Defaults to [] .
|
name
|
A name for the operation (optional).
|
Returns |
The created Operation.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[],[],null,["# tf.raw_ops.EnqueueTPUEmbeddingRaggedTensorBatch\n\n\u003cbr /\u003e\n\nEases the porting of code that uses tf.nn.embedding_lookup().\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.raw_ops.EnqueueTPUEmbeddingRaggedTensorBatch`](https://www.tensorflow.org/api_docs/python/tf/raw_ops/EnqueueTPUEmbeddingRaggedTensorBatch)\n\n\u003cbr /\u003e\n\n tf.raw_ops.EnqueueTPUEmbeddingRaggedTensorBatch(\n sample_splits,\n embedding_indices,\n aggregation_weights,\n mode_override,\n table_ids,\n device_ordinal=-1,\n combiners=[],\n max_sequence_lengths=[],\n num_features=[],\n name=None\n )\n\nsample_splits\\[i\\], embedding_indices\\[i\\] and aggregation_weights\\[i\\] correspond\nto the ith feature. table_ids\\[i\\] indicates which embedding table to look up ith\nfeature.\n\nThe tensors at corresponding positions in two of the input lists,\nembedding_indices and aggregation_weights, must have the same shape, i.e. rank 1\nwith dim_size() equal to the total number of lookups into the table described by\nthe corresponding feature.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `sample_splits` | A list of at least 1 `Tensor` objects with the same type in: `int32`, `int64`. A list of rank 1 Tensors specifying the break points for splitting embedding_indices and aggregation_weights into rows. It corresponds to ids.row_splits in embedding_lookup(), when ids is a RaggedTensor. |\n| `embedding_indices` | A list with the same length as `sample_splits` of `Tensor` objects with the same type in: `int32`, `int64`. A list of rank 1 Tensors, indices into the embedding tables. It corresponds to ids.values in embedding_lookup(), when ids is a RaggedTensor. |\n| `aggregation_weights` | A list with the same length as `sample_splits` of `Tensor` objects with the same type in: `float32`, `float64`. A list of rank 1 Tensors containing per training example aggregation weights. It corresponds to the values field of a RaggedTensor with the same row_splits as ids in embedding_lookup(), when ids is a RaggedTensor. |\n| `mode_override` | A `Tensor` of type `string`. A string input that overrides the mode specified in the TPUEmbeddingConfiguration. Supported values are {'unspecified', 'inference', 'training', 'backward_pass_only'}. When set to 'unspecified', the mode set in TPUEmbeddingConfiguration is used, otherwise mode_override is used. |\n| `table_ids` | A list of `ints`. A list of integers specifying the identifier of the embedding table (offset of TableDescriptor in the TPUEmbeddingConfiguration) to lookup the corresponding input. The ith input is looked up using table_ids\\[i\\]. The size of the table_ids list must be equal to that of sample_indices, embedding_indices and aggregation_weights. |\n| `device_ordinal` | An optional `int`. Defaults to `-1`. The TPU device to use. Should be \\\u003e= 0 and less than the number of TPU cores in the task on which the node is placed. |\n| `combiners` | An optional list of `strings`. Defaults to `[]`. A list of string scalars, one for each embedding table that specify how to normalize the embedding activations after weighted summation. Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have the sum of the weights be 0 for 'mean' or the sum of the squared weights be 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for all tables. |\n| `max_sequence_lengths` | An optional list of `ints`. Defaults to `[]`. |\n| `num_features` | An optional list of `ints`. Defaults to `[]`. |\n| `name` | A name for the operation (optional). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| The created Operation. ||\n\n\u003cbr /\u003e"]]