title: How to compute grads_and_vars with GradientDescentOptimizer
body: <p>I have the following CNN code implementation.</p>
  
  <pre><code>optimizer = tf.train.GradientDescentOptimizer(cnn.learning_rate).minimize(loss = cnn.loss, global_step=global_step)
  grads_and_vars = optimizer.compute_gradients(cnn.loss)
  train_op = optimizer.apply_gradients(grads_and_vars, global_step=global_step)
  </code></pre>
  
  <p>Using it, I get the following error:</p>
  
  <pre><code>grads_and_vars = optimizer.compute_gradients(cnn.loss)
  AttributeError: 'Operation' object has no attribute 'compute_gradients'
  </code></pre>
  
  <p>I noticed that using the above GradientDescentOptimizer implementation with tf.train.exponential_decay does not provide the attribute 'compute_gradients'
   for the optimizer.</p>
  
  <p>Can someone help me with this?</p>