@tf.RegisterGradient('GuidedRelu')
def _GuidedReluGrad(op, grad):
    gate_g = tf.cast((grad > 0), 'float32')
    gate_y = tf.cast((op.outputs[0] > 0), 'float32')
    return ((gate_y * gate_g) * grad)
@tf.RegisterGradient('GuidedRelu')
def _GuidedReluGrad(op, grad):
    gate_g = tf.cast((grad > 0), 'float32')
    gate_y = tf.cast((op.outputs[0] > 0), 'float32')
    return ((gate_y * gate_g) * grad)