code: def make_tf2_graph(input_types):
      """
      Decorator to help construct TensorFlow 2.x model.
  
      Parameters
      ----------
      input_types: list of tuple or list of list
          List of input types. E.g. [(3, 224, 224, tf.int32)] represent 1 input,
          with shape (3, 224, 224), and the expected data type is tf.int32. The
          dtype is optional, in case it's missing, tf.float32 will be used.
  
      Returns
      -------
      list of ConcreteFunction, list of str, list of str
      """
  
      def wrapper(ops):
          input_signature = []
          for input_type in input_types:
              if (
                  input_type is not None
                  and len(input_type) > 0
                  and isinstance(input_type[-1], dtypes.DType)
              ):
                  shape, dtype = input_type[:-1], input_type[-1]
              else:
                  shape, dtype = input_type, tf.float32
              input_signature.append(
                  tf.TensorSpec(shape=shape, dtype=dtype)
              )
  
          @tf.function(input_signature=input_signature)
          def tf2_model(*args):
              return ops(*args)
  
          concrete_func = tf2_model.get_concrete_function()
          inputs = get_tf_node_names(
              [
                  t.name
                  for t in concrete_func.inputs
                  if t.dtype != dtypes.resource
              ],
              mode="input",
          )
          outputs = get_tf_node_names(
              [t.name for t in concrete_func.outputs], mode="output"
          )
          return [concrete_func], inputs, outputs
  
      return wrapper
  
file_path: coremltools/coremltools/converters/mil/frontend/tensorflow2/test/testing_utils.py
imports: import numpy
  import pytest
  from tensorflow.python.framework import dtypes
  import coremltools
  import coremltools.models.utils
  from coremltools.converters.mil.frontend.tensorflow.test.testing_utils import TensorFlowBaseTest, get_tf_node_names
  from coremltools.converters.mil.input_types import RangeDim, TensorType
  from coremltools.converters.mil.testing_utils import compare_backend, ct_convert, validate_minimum_deployment_target
  from coremltools.models.utils import _macos_version
label_desc: Use image node_id 1 for calling a global function with example usage: make_tf2_graph(input_types) and returns: wrapper, list,  inputs,  outputs, ops