How to use tf.nn.embedding_lookup_sparse in TensorFlow?
We have tried using tf.nn.embedding_lookup and it works. But it needs dense input data and now we need tf.nn.embedding_lookup_sparse for sparse input. I have written the following code but get some errors. import tensorflow as tf import numpy as np example1 = tf.SparseTensor(indices=[[4], [7]], values=[1, 1], shape=[10]) example2 = tf.SparseTensor(indices=[[3], [6], [9]], values=[1, 1, 1], shape=[10]) vocabulary_size = 10 embedding_size = 1 var = np.array([0.0, 1.0, 4.0, 9.0, 16.0, 25.0, 36.0, 49.0, 64.0, 81.0]) #embeddings = tf.Variable(tf.ones([vocabulary_size, embedding_size])) embeddings =