title: Tensorflow embedding_lookup gradients registering on CPU?
body: <p>I have something equivalent to a sparse softmax:</p>
  
  <pre><code>...
  with tf.device('/gpu:0'):
      indices = tf.placeholder(tf.int32, [None, dimsize])
      self._W = weight_variable([self._num_nodes, input_layer_size])
      self._b = bias_variable([self._num_nodes])
      sampled_W = tf.transpose(tf.nn.embedding_lookup(self._W, indices), [0,2,1]) # [batchsize, inputlayersize, dim1size]
      sampled_b = tf.nn.embedding_lookup(self._b, indices) # [batchsize, dim1size]
      ...
  </code></pre>
  
  <p>However, when I enable placement logging, I see multiple instances of the gradients being placed on the CPU, e.g.:</p>
  
  <pre><code>gradients/.../embedding_lookup_1_grad/Size: /job:localhost/replica:0/task:0/cpu:0
  
  I tensorflow/core/common_runtime/simple_placer.cc:819] gradients/.../embedding_lookup_1_grad/Size: /job:localhost/replica:0/task:0/cpu:0
  </code></pre>
  
  <p>This happens no matter the optimizer I choose. Am I missing something here?</p>