code: def __init__(self, x, x_min, x_max):
      if x_min is None and x_max is None:
          raise ValueError("must set either max or min")
  
      self.cond = True
      if x_min is not None:
          self.cond *= x_min <= x
      if x_max is not None:
          self.cond *= x <= x_max
  
imports: import numpy
  from chainer.backends import cuda
  from chainer import function_node
  from chainer import utils
  from chainer.utils import type_check
label_desc: Use image node_id 1 to create a new ClipGrad object from inherited base classes: function_node with example: obj = ClipGrad(x, x_min, x_max)