title: Official ZeroOut gradient example error: AttributeError: 'list' object has no attribute 'eval'
body: <p>I followed the official tutorial of the tensorflow website: <a href="https://www.tensorflow.org/extend/adding_an_op" rel="nofollow noreferrer">https://www.tensorflow.org/extend/adding_an_op</a>
  There is also described how to call the gradient of the example ZeroOut in the tutorial that I want to try in this short code snippet underneath. </p>
  
  <p>I have found the code here: <a href="https://github.com/MatteoRagni/tf.ZeroOut.gpu" rel="nofollow noreferrer">https://github.com/MatteoRagni/tf.ZeroOut.gpu</a></p>
  
  <pre><code>import numpy as np
  import tensorflow as tf
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import sparse_ops
  zero_out_module = tf.load_op_library('./libzeroout.so')
  @ops.RegisterGradient("ZeroOut")
  def _zero_out_grad(op, grad):
       to_zero = op.inputs[0]
       shape = array_ops.shape(to_zero)
       index = array_ops.zeros_like(shape)
       first_grad = array_ops.reshape(grad, [-1])[0]
       to_zero_grad = sparse_ops.sparse_to_dense([index], shape, first_grad, 0)
       return [to_zero_grad]  # List of one Tensor, since we have one input
  
  t_in = tf.placeholder(tf.int32, [None,None])
  ret = zero_out_module.zero_out(t_in)
  grad = tf.gradients(ys=tf.reduce_sum(ret), xs=t_in)
  with tf.Session(''):
      feed_dict = {t_in: [[1, 2], [3, 4]]}
      print "ret val: ", ret.eval(feed_dict=feed_dict)
      print "grad: ", grad
      print "grad: ", grad.eval(feed_dict=feed_dict)
  </code></pre>
  
  <p>I got this error ...</p>
  
  <pre><code>AttributeError: 'list' object has no attribute 'eval'
  </code></pre>
  
  <p>... but I can do ret.eval().</p>
  
  <p>Why I cant call grad.eval()? I want to see these values inside the grad tensor. How to debug gradient?</p>