I am trying to implement Embedding layer for text classification using CNN.
Embedding layer
with tf.device('/cpu:0'), tf.name_scope("embedding"):
self.W = tf.Variable(tf.random_uniform([vocab_size, embedding_size], -1.0, 1.0),name="W")
self.embedded_chars = tf.nn.embedding_lookup(self.W, self.inputTensor)
self.embedded_chars_expanded = tf.expand_dims(self.embedded_chars, -1)
I couldn't understand tf.nn.embedding_lookup working.