tf.compat.v1.tpu.experimental.embedding_column

View source on GitHub

TPU version of tf.compat.v1.feature_column.embedding_column.

tf.compat.v1.tpu.experimental.embedding_column(
    categorical_column, dimension, combiner='mean', initializer=None,
    max_sequence_length=0, learning_rate_fn=None, embedding_lookup_device=None,
    tensor_core_shape=None
)

Note that the interface for tf.tpu.experimental.embedding_column is different from that of tf.compat.v1.feature_column.embedding_column: The following arguments are NOT supported: ckpt_to_load_from, tensor_name_in_ckpt, max_norm and trainable.

Use this function in place of tf.compat.v1.feature_column.embedding_column when you want to use the TPU to accelerate your embedding lookups via TPU embeddings.

column = tf.feature_column.categorical_column_with_identity(...)
tpu_column = tf.tpu.experimental.embedding_column(column, 10)
...
def model_fn(features):
  dense_feature = tf.keras.layers.DenseFeature(tpu_column)
  embedded_feature = dense_feature(features)
  ...

estimator = tf.estimator.tpu.TPUEstimator(
    model_fn=model_fn,
    ...
    embedding_config_spec=tf.estimator.tpu.experimental.EmbeddingConfigSpec(
      column=[tpu_column],
      ...))

Args:

Returns:

A _TPUEmbeddingColumnV2.

Raises: