parameters: (self, x)
return_statement: return x
docstring: Args:
              x (CTensor): input tensor
          Returns:
              a new CTensor with np.clip(x,min,max)
docstring_summary: Args:
              x (CTensor): input tensor
          Returns:
              a new CTensor with np.clip(x,min,max)
docstring_tokens: Args : x ( CTensor ) : input tensor Returns : a new CTensor with np . clip ( x min max )
function: def forward(self, x):
          """
          Args:
              x (CTensor): input tensor
          Returns:
              a new CTensor with np.clip(x,min,max)
          """
          self.mask = singa.Tensor(list(x.shape()), x.device())
          self.mask.SetFloatValue(1.0)
  
          if self.min is not None:
              self.min = float(self.min)
              mask0 = singa.LTFloat(x, self.min)
              mask1 = singa.GEFloat(x, self.min)
              self.mask = singa.__mul__(mask1, self.mask)
              x = singa.__add__(singa.MultFloat(mask0, self.min),
                                singa.__mul__(mask1, x))
  
          if self.max is not None:
              self.max = float(self.max)
              mask0 = singa.GTFloat(x, self.max)
              mask1 = singa.LEFloat(x, self.max)
              self.mask = singa.__mul__(mask1, self.mask)
              x = singa.__add__(singa.MultFloat(mask0, self.max),
                                singa.__mul__(mask1, x))
  
          return x
function_tokens: def forward ( self , x ) : self . mask = singa . Tensor ( list ( x . shape ( ) ) , x . device ( ) ) self . mask . SetFloatValue ( 1.0 ) if self . min is not None : self . min = float ( self . min ) mask0 = singa . LTFloat ( x , self . min ) mask1 = singa . GEFloat ( x , self . min ) self . mask = singa . __mul__ ( mask1 , self . mask ) x = singa . __add__ ( singa . MultFloat ( mask0 , self . min ) , singa . __mul__ ( mask1 , x ) ) if self . max is not None : self . max = float ( self . max ) mask0 = singa . GTFloat ( x , self . max ) mask1 = singa . LEFloat ( x , self . max ) self . mask = singa . __mul__ ( mask1 , self . mask ) x = singa . __add__ ( singa . MultFloat ( mask0 , self . max ) , singa . __mul__ ( mask1 , x ) ) return x