'Embeddings at the given index will be set to pretrained values.'

def AddPretrainedEmbeddings(self, index, embeddings_path, task_context):

    def _Initializer(shape, dtype=tf.float32, partition_info=None):
        'Variable    initializer    that    loads    pretrained    embeddings.'
        unused_dtype = dtype
        (seed1, seed2) = tf.get_seed(self._seed)
        t = gen_parser_ops.word_embedding_initializer(vectors=embeddings_path, task_context=task_context, embedding_init=self._embedding_init, seed=seed1, seed2=seed2)
        t.set_shape(shape)
        return t
    self._pretrained_embeddings[index] = _Initializer
