class_docstr: QuantizationRegistry for built-in Keras classes for default 8-bit scheme.
class_docstr_tok: ["QuantizationRegistry","for","built-in","Keras","classes","for","default","8-bit","scheme","."]
code: def __init__(
      self,
      disable_per_axis=False,
      num_bits_weight=8,
      num_bits_activation=8,
  ):
      self._disable_per_axis = disable_per_axis
      self._num_bits_weight = num_bits_weight
      self._num_bits_activation = num_bits_activation
      self._layer_quantize_map = {}
      for quantize_info in self._LAYER_QUANTIZE_INFO:
          quantize_info.num_bits_weight = num_bits_weight
          quantize_info.num_bits_activation = num_bits_activation
          self._layer_quantize_map[
              quantize_info.layer_type
          ] = quantize_info
  
      # Hack for `Activation` layer. That is the only layer with a separate
      # QuantizeConfig.
      self._layer_quantize_map[
          layers.Activation
      ] = DefaultNBitActivationQuantizeConfig(
          num_bits_weight=self._num_bits_weight,
          num_bits_activation=self._num_bits_activation,
      )
  
      self._layer_quantize_map[
          layers.Conv2DTranspose
      ] = DefaultNBitConvTransposeQuantizeConfig(
          ["kernel"],
          ["activation"],
          False,
          num_bits_weight=self._num_bits_weight,
          num_bits_activation=self._num_bits_activation,
      )
  
      if not self._disable_per_axis:
          self._layer_quantize_map[
              layers.Conv2D
          ] = DefaultNBitConvQuantizeConfig(
              ["kernel"],
              ["activation"],
              False,
              num_bits_weight=self._num_bits_weight,
              num_bits_activation=self._num_bits_activation,
          )
          self._layer_quantize_map[
              layers.DepthwiseConv2D
          ] = DefaultNBitConvQuantizeConfig(
              ["depthwise_kernel"],
              ["activation"],
              False,
              num_bits_weight=self._num_bits_weight,
              num_bits_activation=self._num_bits_activation,
          )
      else:
          self._layer_quantize_map[
              layers.Conv2D
          ] = DefaultNBitQuantizeConfig(
              ["kernel"],
              ["activation"],
              False,
              num_bits_weight=self._num_bits_weight,
              num_bits_activation=self._num_bits_activation,
          )
          self._layer_quantize_map[
              layers.DepthwiseConv2D
          ] = DefaultNBitQuantizeConfig(
              ["depthwise_kernel"],
              ["activation"],
              False,
              num_bits_weight=self._num_bits_weight,
              num_bits_activation=self._num_bits_activation,
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Any, Dict
  import tensorflow
  from tensorflow_model_optimization.python.core.quantization.keras import quantize_config
  from tensorflow_model_optimization.python.core.quantization.keras import quantize_registry
  from tensorflow_model_optimization.python.core.quantization.keras import quantizers
  from tensorflow_model_optimization.python.core.quantization.keras.experimental.default_n_bit import default_n_bit_quantize_configs
  from tensorflow_model_optimization.python.core.quantization.keras.experimental.default_n_bit import default_n_bit_quantizers
label_desc: Use image node_id 1 to create a new DefaultNBitQuantizeRegistry object from inherited base classes: quantize_registry, _RNNHelper with example: obj = DefaultNBitQuantizeRegistry(disable_per_axis, num_bits_weight, num_bits_activation)