docstr: Tests the Concat Transform.
  
     Input  Input
      /       \
    Relu     Relu
      \       /
        Concat
  
  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","Input","\/","\\","Relu","Relu","\\","\/","Concat","The","Transform","should","ensure","both","the","output","FakeQuants","are","disabled",",","and","only","a","FakeQuant","after","Concat","is","present","."]
code: def testConcatActivationTransform(self):
      r"""Tests the Concat Transform.
  
           Input  Input
            /       \
          Relu     Relu
            \       /
              Concat
  
        The Transform should ensure both the output FakeQuants are disabled,
        and only a FakeQuant after Concat is present.
      """
      relu_1 = keras.layers.Activation("relu")
      relu_2 = keras.layers.Activation("relu")
      concat = keras.layers.Concatenate()
  
      inp1 = keras.layers.Input((2,))
      inp2 = keras.layers.Input((2,))
      x1 = relu_1(inp1)
      x2 = relu_2(inp2)
      x = concat([x1, x2])
      model = keras.Model([inp1, inp2], x)
  
      layer_metadata = {
          # dense_1 has an existing quantize_config.
          relu_1.name: {
              "quantize_config": (
                  default_8bit_quantize_registry.Default8BitActivationQuantizeConfig()
              )
          },
          relu_2.name: {
              "quantize_config": (
                  default_8bit_quantize_registry.Default8BitActivationQuantizeConfig()
              )
          },
      }
      _, updated_metadata = ModelTransformer(
          model,
          [default_8bit_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,
          default_8bit_quantize_configs.Default8BitOutputQuantizeConfig,
      )
      self.assertNotEmpty(
          concat_quantize_config.get_output_quantizers(None)
      )
  
      relu_1_quantize_config = updated_metadata.get(relu_1.name).get(
          "quantize_config"
      )
      # The existing quantize_config should do nothing for outputs.
      self.assertIsInstance(
          relu_1_quantize_config,
          default_8bit_quantize_registry.Default8BitActivationQuantizeConfig,
      )
      self.assertEmpty(
          relu_1_quantize_config.get_output_quantizers(None)
      )
      self.assertFalse(relu_1_quantize_config.quantize_output)
  
      relu_2_quantize_config = updated_metadata.get(relu_2.name).get(
          "quantize_config"
      )
      # The quantize_config from registry should do nothing at output.
      self.assertIsInstance(
          relu_1_quantize_config,
          default_8bit_quantize_registry.Default8BitActivationQuantizeConfig,
      )
      self.assertEmpty(
          relu_2_quantize_config.get_output_quantizers(None)
      )
      self.assertFalse(relu_2_quantize_config.quantize_output)
  
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.default_8bit import default_8bit_quantize_configs
  from tensorflow_model_optimization.python.core.quantization.keras.default_8bit import default_8bit_quantize_registry
  from tensorflow_model_optimization.python.core.quantization.keras.default_8bit import default_8bit_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 21 for calling the DefaultTransformsTest obj's underlying member method code with example usage: obj.testConcatActivationTransform() without return types