title: Trying to redefine the tensor gradient function for rounding in theano
body: <p>I am trying find a gradient of a variable, but because I rounded the variable before hand, theano's gradient function registers the gradient as 0 (since rounding is a discontinuous function). For example,</p>
  
  <pre><code>import theano
  import theano.tensor as T
  
  x = T.scalar()
  y = T.round(x)**2
  
  dy = T.grad(y, x)
  
  df = theano.function(inputs=[x],outputs = dy)
  
  print(df(3))
  </code></pre>
  
  <p>returns 0.0 but I want it to return 2x.</p>
  
  <p>Is there a way to make the gradient of T.round(x) to act like x?</p>