parameters: (self,
                   min_init=-6,
                   max_init=6,
                   ema=False,
                   ema_decay=0.999,
                   per_channel=False,
                   channel_axis=1,
                   num_channels=1,
                   quant_dtype=QuantDtype.INT8,
                   symmetric=False,
                   narrow_range=False,
                   quant_delay=0,
                   neg_trunc=False,
                   mode="DEFAULT")
docstring: Initialize FakeQuantWithMinMaxObserver
docstring_summary: Initialize FakeQuantWithMinMaxObserver
docstring_tokens: Initialize FakeQuantWithMinMaxObserver
function: def __init__(self,
                   min_init=-6,
                   max_init=6,
                   ema=False,
                   ema_decay=0.999,
                   per_channel=False,
                   channel_axis=1,
                   num_channels=1,
                   quant_dtype=QuantDtype.INT8,
                   symmetric=False,
                   narrow_range=False,
                   quant_delay=0,
                   neg_trunc=False,
                   mode="DEFAULT"):
          """Initialize FakeQuantWithMinMaxObserver"""
          super(FakeQuantWithMinMaxObserver, self).__init__(quant_dtype=quant_dtype, per_channel=per_channel,
                                                            symmetric=symmetric, narrow_range=narrow_range,
                                                            num_channels=num_channels)
          Validator.check_value_type("min_init", min_init, [int, float, list], type(self).__name__)
          Validator.check_value_type("max_init", max_init, [int, float, list], type(self).__name__)
          Validator.check_non_negative_int(quant_delay, 'quant_delay', self.cls_name)
          self.min_init = min_init
          self.max_init = max_init
          self.quant_dtype = quant_dtype
          self.num_bits = quant_dtype.num_bits
          self.ema = ema
          self.ema_decay = ema_decay
          self.per_channel = per_channel
          self.num_channels = num_channels
          self.channel_axis = channel_axis
          self.quant_delay = quant_delay
          self.symmetric = symmetric
          self.narrow_range = narrow_range
          self.neg_trunc = neg_trunc
          self.mode = mode
          self.is_ascend = context.get_context('device_target') == "Ascend"
          self.Neg = P.Neg()
  
          min_array = self._get_init_array(self.min_init)
          max_array = self._get_init_array(self.max_init)
          if not np.greater(max_array, min_array).all():
              raise ValueError(f"For '{self.cls_name}', the 'max_init' should be greater than 'min_init', "
                               f"but got 'max_init': {max_init}, 'min_init': {min_init}.")
          if self.mode == "DEFAULT":
              self._default_init(min_array, max_array)
          elif self.mode == "LEARNED_SCALE":
              self._learned_scale_init(min_array, max_array)
          else:
              raise ValueError(f"For '{self.cls_name}', only `DEFAULT` and `LEARNED_SCALE` mode are valid, but got "
                               f"'mode': {self.mode}.")
function_tokens: def __init__ ( self , min_init = - 6 , max_init = 6 , ema = False , ema_decay = 0.999 , per_channel = False , channel_axis = 1 , num_channels = 1 , quant_dtype = QuantDtype . INT8 , symmetric = False , narrow_range = False , quant_delay = 0 , neg_trunc = False , mode = "DEFAULT" ) : super ( FakeQuantWithMinMaxObserver , self ) . __init__ ( quant_dtype = quant_dtype , per_channel = per_channel , symmetric = symmetric , narrow_range = narrow_range , num_channels = num_channels ) Validator . check_value_type ( "min_init" , min_init , [ int , float , list ] , type ( self ) . __name__ ) Validator . check_value_type ( "max_init" , max_init , [ int , float , list ] , type ( self ) . __name__ ) Validator . check_non_negative_int ( quant_delay , 'quant_delay' , self . cls_name ) self . min_init = min_init self . max_init = max_init self . quant_dtype = quant_dtype self . num_bits = quant_dtype . num_bits self . ema = ema self . ema_decay = ema_decay self . per_channel = per_channel self . num_channels = num_channels self . channel_axis = channel_axis self . quant_delay = quant_delay self . symmetric = symmetric self . narrow_range = narrow_range self . neg_trunc = neg_trunc self . mode = mode self . is_ascend = context . get_context ( 'device_target' ) == "Ascend" self . Neg = P . Neg ( ) min_array = self . _get_init_array ( self . min_init ) max_array = self . _get_init_array ( self . max_init ) if not np . greater ( max_array , min_array ) . all ( ) : raise ValueError ( f"For '{self.cls_name}', the 'max_init' should be greater than 'min_init', " f"but got 'max_init': {max_init}, 'min_init': {min_init}." ) if self . mode == "DEFAULT" : self . _default_init ( min_array , max_array ) elif self . mode == "LEARNED_SCALE" : self . _learned_scale_init ( min_array , max_array ) else : raise ValueError ( f"For '{self.cls_name}', only `DEFAULT` and `LEARNED_SCALE` mode are valid, but got " f"'mode': {self.mode}." )