code: def zero_out_clipped_grads(grad, x, clip_min, clip_max):
      """
      Helper function to erase entries in the gradient where the update would be
      clipped.
      :param grad: The gradient
      :param x: The current input
      :param clip_min: Minimum input component value
      :param clip_max: Maximum input component value
      """
      signed_grad = tf.sign(grad)
  
      # Find input components that lie at the boundary of the input range, and
      # where the gradient points in the wrong direction.
      clip_low = tf.logical_and(
          tf.less_equal(x, tf.cast(clip_min, x.dtype)),
          tf.less(signed_grad, 0),
      )
      clip_high = tf.logical_and(
          tf.greater_equal(x, tf.cast(clip_max, x.dtype)),
          tf.greater(signed_grad, 0),
      )
      clip = tf.logical_or(clip_low, clip_high)
      grad = tf.where(clip, mul(grad, 0), grad)
  
      return grad
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import logging
  import math
  import os
  import time
  import warnings
  import numpy
  import six
  from six.moves import xrange
  import tensorflow
  from cleverhans.compat import device_lib
  from cleverhans.compat import reduce_sum, reduce_mean
  from cleverhans.compat import reduce_max
  from cleverhans.compat import softmax_cross_entropy_with_logits
  from cleverhans.utils import batch_indices, _ArgsWrapper, create_logger
label_desc: Use image node_id 11 for calling a global function with example usage: zero_out_clipped_grads(grad, x, clip_min, clip_max) and returns: grad