docstr: Tests the Concat Transform.
  
      Input    Input   Input  Input
      Reshape Reshape Reshape Reshape
          \    /           \    /
         Concat           Concat
               \         /
                  Concat
  
  The Transform should ensure all output FakeQuants are disabled,
    and only a FakeQuant after the last Concat is present.
docstr_tok: ["Tests","the","Concat","Transform",".","Input","Input","Input","Input","Reshape","Reshape","Reshape","Reshape","\\","\/","\\","\/","Concat","Concat","\\","\/","Concat","The","Transform","should","ensure","all","output","FakeQuants","are","disabled",",","and","only","a","FakeQuant","after","the","last","Concat","is","present","."]
code: def testConcatConcatTransformDisablesOutput(self):
      r"""Tests the Concat Transform.
  
          Input    Input   Input  Input
          Reshape Reshape Reshape Reshape
              \    /           \    /
             Concat           Concat
                   \         /
                      Concat
  
      The Transform should ensure all output FakeQuants are disabled,
        and only a FakeQuant after the last Concat is present.
      """
      flatten_1 = keras.layers.Flatten()
      flatten_2 = keras.layers.Flatten()
      concat_1 = keras.layers.Concatenate()
      flatten_3 = keras.layers.Flatten()
      flatten_4 = keras.layers.Flatten()
      concat_2 = keras.layers.Concatenate()
      concat = keras.layers.Concatenate()
  
      inp1 = keras.layers.Input((1, 2, 2))
      inp2 = keras.layers.Input((1, 2, 2))
      inp3 = keras.layers.Input((1, 2, 2))
      inp4 = keras.layers.Input((1, 2, 2))
      x1 = flatten_1(inp1)
      x2 = flatten_2(inp2)
      x3 = flatten_3(inp3)
      x4 = flatten_4(inp4)
  
      y1 = concat_1([x1, x2])
      y2 = concat_2([x3, x4])
      z = concat([y1, y2])
      model = keras.Model([inp1, inp2, inp3, inp4], z)
      reshapes = [flatten_1, flatten_2, flatten_3, flatten_4]
      layer_metadata = {}
      for layer in reshapes:
          layer_metadata[layer.name] = {
              "quantize_config": default_8bit_quantize_registry.Default8BitQuantizeConfig(
                  [], [], True
              )
          }
      _, 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)
      )
  
      # The existing quantize_config should do nothing for outputs.
      for layer in reshapes:
          quantize_config = updated_metadata.get(layer.name).get(
              "quantize_config"
          )
          self.assertIsInstance(
              quantize_config,
              default_8bit_quantize_registry.Default8BitQuantizeConfig,
          )
          self.assertEmpty(quantize_config.get_output_quantizers(layer))
          self.assertFalse(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 22 for calling the DefaultTransformsTest obj's underlying member method code with example usage: obj.testConcatConcatTransformDisablesOutput() without return types