Does the below link help?

http://stackoverflow.com/questions/40613225/theano-how-to-override-gradient-for-part-of-op-graph



On Sunday, April 23, 2017 at 3:27:49 PM UTC+8, Bohan Zhuang wrote:
>
> Recently, I found a piece of code written in Tensorflow. It serves to 
> overriding tf.round()'s gradient function with tf.identity()'s using 
> gradient_override_map function:
>
> import tensorflow as tf
> G = tf.get_default_graph()
> def quantize(x, k):
>         n = float(2**k - 1)
>         with G.gradient_override_map({"Round": "Identity"}):
>             return tf.round(x * n) / n
>
> And I want to implement it in Theano but have no idea....So could anyone 
> provide some advice on that? 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to