title: tf.gradients application on a function
body: <pre><code>x = tf.Placeholder(shape=[1,31,5,1])
  def func(x):
      operations...
      return output
  
  convolutionFunction = func(x)
  sess = tf.Session()
  gradientConv1 = gradientConv1 + sess.run(tf.gradients(tf.square(reward-convolutionFunction), weightsConv1))
  </code></pre>
  
  <p>gradientConv1 (numpy array of shape [2,2,1,32])
  weightsConv1 (tensor variable of shape [2,2,1,32])</p>
  
  <p>I'm getting an error such that "Placeholder should have a dtype of float and shape of [1,31,5,1]". It seems that it is showing me that I have not given a feed_dict to the function in sess.run? Please point me out to the error.
  Also is my way of differentiating with respect to each value correct.</p>
  
  <p>reward is a scalar</p>