parameters: (categorical_column,
                       dimension,
                       combiner='mean',
                       initializer=None,
                       max_sequence_length=0,
                       learning_rate_fn=None)
return_statement: return column
docstring: TPU embedding_column for `tf.feature_column.embedding_column`.
  
    Note that the interface for TPU embedding_column is different from the non-TPU
    version. The following args available for the non-TPU version are NOT
    supported: ckpt_to_load_from, tensor_name_in_ckp, max_norm and trainable.
  
    Args:
      categorical_column: A categorical_column returned from
          categorical_column_with_identity, weighted_categorical_column,
          categorical_column_with_vocabulary_file,
          categorical_column_with_vocabulary_list,
          sequence_categorical_column_with_identity,
          sequence_categorical_column_with_vocabulary_file,
          sequence_categorical_column_with_vocabulary_list
      dimension: An integer specifying dimension of the embedding, must be > 0.
      combiner: A string specifying how to reduce if there are multiple entries
        in a single row for a non-sequence column. For more information, see
        `tf.feature_column.embedding_column`.
      initializer: A variable initializer function to be used in embedding
        variable initialization. If not specified, defaults to
        `tf.compat.v1.truncated_normal_initializer` with mean `0.0` and
        standard deviation `1/sqrt(dimension)`.
      max_sequence_length: An non-negative integer specifying the max sequence
        length. Any sequence shorter then this will be padded with 0 embeddings
        and any sequence longer will be truncated. This must be positive for
        sequence features and 0 for non-sequence features.
      learning_rate_fn: A function that takes global step and returns learning
        rate for the embedding table.
  
    Returns:
      A  _TPUEmbeddingColumn.
  
    Raises:
      ValueError: if `dimension` not > 0.
      ValueError: if `initializer` is specified but not callable.
docstring_summary: TPU embedding_column for `tf.feature_column.embedding_column`.
docstring_tokens: TPU embedding_column for tf . feature_column . embedding_column .
function: def embedding_column(categorical_column,
                       dimension,
                       combiner='mean',
                       initializer=None,
                       max_sequence_length=0,
                       learning_rate_fn=None):
    """TPU embedding_column for `tf.feature_column.embedding_column`.
  
    Note that the interface for TPU embedding_column is different from the non-TPU
    version. The following args available for the non-TPU version are NOT
    supported: ckpt_to_load_from, tensor_name_in_ckp, max_norm and trainable.
  
    Args:
      categorical_column: A categorical_column returned from
          categorical_column_with_identity, weighted_categorical_column,
          categorical_column_with_vocabulary_file,
          categorical_column_with_vocabulary_list,
          sequence_categorical_column_with_identity,
          sequence_categorical_column_with_vocabulary_file,
          sequence_categorical_column_with_vocabulary_list
      dimension: An integer specifying dimension of the embedding, must be > 0.
      combiner: A string specifying how to reduce if there are multiple entries
        in a single row for a non-sequence column. For more information, see
        `tf.feature_column.embedding_column`.
      initializer: A variable initializer function to be used in embedding
        variable initialization. If not specified, defaults to
        `tf.compat.v1.truncated_normal_initializer` with mean `0.0` and
        standard deviation `1/sqrt(dimension)`.
      max_sequence_length: An non-negative integer specifying the max sequence
        length. Any sequence shorter then this will be padded with 0 embeddings
        and any sequence longer will be truncated. This must be positive for
        sequence features and 0 for non-sequence features.
      learning_rate_fn: A function that takes global step and returns learning
        rate for the embedding table.
  
    Returns:
      A  _TPUEmbeddingColumn.
  
    Raises:
      ValueError: if `dimension` not > 0.
      ValueError: if `initializer` is specified but not callable.
    """
    if not isinstance(categorical_column, _SUPPORTED_CATEGORICAL_COLUMNS):
      raise TypeError(
          'categorical_column for tpu '
          ' embedding_column must be type %s, got %s.' % (' or '.join([
              cc.__name__ for cc in _SUPPORTED_CATEGORICAL_COLUMNS
          ]), type(categorical_column)))
    if (dimension is None) or (dimension < 1):
      raise ValueError('Invalid dimension {}.'.format(dimension))
  
    if (initializer is not None) and (not callable(initializer)):
      raise ValueError('initializer must be callable if specified. '
                       'Embedding of column_name: {}'.format(
                           categorical_column.name))
    if initializer is None:
      initializer = init_ops.truncated_normal_initializer(
          mean=0.0, stddev=1 / math.sqrt(dimension))
  
    embedding_shape = categorical_column._num_buckets, dimension  # pylint: disable=protected-access
  
    def _creator(weight_collections, scope):
      embedding_column_layer = fc._EmbeddingColumnLayer(
          embedding_shape=embedding_shape,
          initializer=initializer,
          weight_collections=weight_collections,
          trainable=True,
          name='embedding_column_layer')
      return embedding_column_layer(None, scope=scope)  # pylint: disable=not-callable
  
    column = _TPUEmbeddingColumn(
        categorical_column=categorical_column,
        dimension=dimension,
        combiner=combiner,
        layer_creator=_creator,
        ckpt_to_load_from=None,
        tensor_name_in_ckpt=None,
        max_norm=None,
        trainable=True,
        max_sequence_length=max_sequence_length,
        learning_rate_fn=learning_rate_fn)
    # For Embedding column, the initializer is hidden inside the creator Fn, which
    # is not accessiable later. So, we attach it to a speicial field. Also note
    # that non-TPU Embedding column and non-TPU shared Embedding column handle the
    # initializer differently. See shared_embedding_columns for details.
    column._tpu_initializer = initializer
    return column
function_tokens: def embedding_column ( categorical_column , dimension , combiner = 'mean' , initializer = None , max_sequence_length = 0 , learning_rate_fn = None ) : if not isinstance ( categorical_column , _SUPPORTED_CATEGORICAL_COLUMNS ) : raise TypeError ( 'categorical_column for tpu ' ' embedding_column must be type %s, got %s.' % ( ' or ' . join ( [ cc . __name__ for cc in _SUPPORTED_CATEGORICAL_COLUMNS ] ) , type ( categorical_column ) ) ) if ( dimension is None ) or ( dimension < 1 ) : raise ValueError ( 'Invalid dimension {}.' . format ( dimension ) ) if ( initializer is not None ) and ( not callable ( initializer ) ) : raise ValueError ( 'initializer must be callable if specified. ' 'Embedding of column_name: {}' . format ( categorical_column . name ) ) if initializer is None : initializer = init_ops . truncated_normal_initializer ( mean = 0.0 , stddev = 1 / math . sqrt ( dimension ) ) embedding_shape = categorical_column . _num_buckets , dimension # pylint: disable=protected-access def _creator ( weight_collections , scope ) : embedding_column_layer = fc . _EmbeddingColumnLayer ( embedding_shape = embedding_shape , initializer = initializer , weight_collections = weight_collections , trainable = True , name = 'embedding_column_layer' ) return embedding_column_layer ( None , scope = scope ) # pylint: disable=not-callable column = _TPUEmbeddingColumn ( categorical_column = categorical_column , dimension = dimension , combiner = combiner , layer_creator = _creator , ckpt_to_load_from = None , tensor_name_in_ckpt = None , max_norm = None , trainable = True , max_sequence_length = max_sequence_length , learning_rate_fn = learning_rate_fn ) # For Embedding column, the initializer is hidden inside the creator Fn, which # is not accessiable later. So, we attach it to a speicial field. Also note # that non-TPU Embedding column and non-TPU shared Embedding column handle the # initializer differently. See shared_embedding_columns for details. column . _tpu_initializer = initializer return column