@tf.RegisterGradient("<STR_LIT>")<EOL>def _quantize_grad(op, grad):
return tf.clip_by_value(grad, -<NUM_LIT:1>, <NUM_LIT:1>)<EOL>
Clip and binarize tensor using the straight through estimator (STE) for the gradient.