'Adds an embedding matrix and passes the `features` vector through it.'

def _AddEmbedding(self, features, num_features, num_ids, embedding_size, index, return_average=False):

    embedding_matrix = self._AddParam([num_ids, embedding_size], tf.float32, ('embedding_matrix_%d' % index), self._EmbeddingMatrixInitializer(index, embedding_size), return_average=return_average)
    embedding = EmbeddingLookupFeatures(embedding_matrix, tf.reshape(features, [(-1)], name=('feature_%d' % index)), self._allow_feature_weights)
    return tf.reshape(embedding, [(-1), (num_features * embedding_size)])
