docstr: Tests the Concat Transform.
  
           Input
          /     \
     Dense       Dense
         \      /
          Concat
  
  One Dense layer has a pre-specified QuantizeConfig, whereas the other does
  not. The Transform should ensure both the output FakeQuants are disabled,
  and only a FakeQuant after Concat is present.
docstr_tok: ["Tests","the","Concat","Transform",".","Input","\/","\\","Dense","Dense","\\","\/","Concat","One","Dense","layer","has","a","pre-specified","QuantizeConfig",",","whereas","the","other","does","not",".","The","Transform","should","ensure","both","the","output","FakeQuants","are","disabled",",","and","only","a","FakeQuant","after","Concat","is","present","."]
code: def testConcatTransform(self):
      r"""Tests the Concat Transform.
  
                 Input
                /     \
           Dense       Dense
               \      /
                Concat
  
        One Dense layer has a pre-specified QuantizeConfig, whereas the other does
        not. The Transform should ensure both the output FakeQuants are disabled,
        and only a FakeQuant after Concat is present.
      """
      dense_1 = keras.layers.Dense(3)
      dense_2 = keras.layers.Dense(3)
      concat = keras.layers.Concatenate()
  
      inp = keras.layers.Input((2,))
      x1 = dense_1(inp)
      x2 = dense_2(inp)
      x = concat([x1, x2])
      model = keras.Model(inp, x)
  
      layer_metadata = {
          # dense_1 has an existing quantize_config.
          dense_1.name: {
              "quantize_config": n_bit_configs.DefaultNBitOutputQuantizeConfig()
          }
      }
      _, updated_metadata = ModelTransformer(
          model,
          [default_n_bit_transforms.ConcatTransform()],
          layer_metadata=layer_metadata,
      ).transform()
  
      concat_quantize_config = updated_metadata.get(concat.name).get(
          "quantize_config"
      )
      # Concat should quantize the output.
      self.assertIsInstance(
          concat_quantize_config,
          n_bit_configs.DefaultNBitOutputQuantizeConfig,
      )
      self.assertNotEmpty(
          concat_quantize_config.get_output_quantizers(None)
      )
  
      dense_1_quantize_config = updated_metadata.get(dense_1.name).get(
          "quantize_config"
      )
      # The existing quantize_config should do nothing for outputs.
      self.assertIsInstance(
          dense_1_quantize_config,
          n_bit_configs.DefaultNBitOutputQuantizeConfig,
      )
      self.assertEmpty(
          dense_1_quantize_config.get_output_quantizers(None)
      )
  
      dense_2_quantize_config = updated_metadata.get(dense_2.name).get(
          "quantize_config"
      )
      # The quantize_config from registry should do nothing at output.
      self.assertEqual(
          "DefaultNBitQuantizeConfig",
          dense_2_quantize_config.__class__.__name__,
      )
      self.assertEmpty(
          dense_2_quantize_config.get_output_quantizers(None)
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow_model_optimization.python.core.quantization.keras import quantize_aware_activation
  from tensorflow_model_optimization.python.core.quantization.keras import quantize_layer
  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_transforms
  from tensorflow_model_optimization.python.core.quantization.keras.graph_transformations import model_transformer
  from tensorflow_model_optimization.python.core.quantization.keras.layers import conv_batchnorm_test_utils
  from tensorflow_model_optimization.python.core.quantization.keras.layers import dense_batchnorm_test_utils
label_desc: Use image node_id 19 for calling the DefaultTransformsTest obj's underlying member method code with example usage: obj.testConcatTransform() without return types