code: def testCustomWeightQuantizers_Run(self, quantizer_type):
      init_params = self._get_quant_params(quantizer_type)
  
      # Additional test that same quantizer object can be shared
      # between Configs, though we don't expicitly promote this
      # anywhere in the documentation.
      quantizer = quantizer_type(**init_params)
  
      class DenseQuantizeConfig(QuantizeConfig):
          """Custom QuantizeConfig for Dense layer."""
  
          def get_weights_and_quantizers(self, layer):
              return [(layer.kernel, quantizer)]
  
          def get_activations_and_quantizers(self, layer):
              # Defaults.
              return [
                  (
                      layer.activation,
                      MovingAverageQuantizer(
                          num_bits=8,
                          per_axis=False,
                          symmetric=False,
                          narrow_range=False,
                      ),
                  )
              ]
  
          def set_quantize_weights(self, layer, quantize_weights):
              layer.kernel = quantize_weights[0]
  
          def set_quantize_activations(
              self, layer, quantize_activations
          ):
              return
  
          def get_output_quantizers(self, layer):
              return []
  
          def get_config(self):
              return {}
  
      annotated_model = tf.keras.Sequential(
          [
              quantize.quantize_annotate_layer(
                  l.Dense(8, input_shape=(10,)), DenseQuantizeConfig()
              ),
              quantize.quantize_annotate_layer(
                  l.Dense(5), DenseQuantizeConfig()
              ),
          ]
      )
  
      with quantize.quantize_scope(
          {"DenseQuantizeConfig": DenseQuantizeConfig}
      ):
          quant_model = quantize.quantize_apply(annotated_model)
  
      # Check no error happens.
      self._train_model(quant_model)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tempfile
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow_model_optimization.python.core.keras import compat
  from tensorflow_model_optimization.python.core.keras import test_utils
  from tensorflow_model_optimization.python.core.quantization.keras import quantize
  from tensorflow_model_optimization.python.core.quantization.keras import quantize_config
  from tensorflow_model_optimization.python.core.quantization.keras import quantizers
label_desc: Use image node_id 6 for calling the QuantizeIntegrationTest obj's underlying member method code with example usage: obj.testCustomWeightQuantizers_Run(quantizer_type) and returns: list, list, list, dict