code: def testFlexWithCustomOp(self):
      new_graph, inputs, outputs = self._createGraphWithCustomOp(
          opname="CustomAdd4"
      )
  
      # Import to load the custom opdef.
      saved_model_dir = os.path.join(self.get_temp_dir(), "model")
      with ops.Graph().as_default():
          with session.Session() as sess:
              import_graph_def(new_graph, name="")
              saved_model.simple_save(
                  sess, saved_model_dir, inputs, outputs
              )
  
      converter = lite.TFLiteConverterV2.from_saved_model(
          saved_model_dir
      )
      converter.target_spec.supported_ops = set(
          [lite.OpsSet.SELECT_TF_OPS]
      )
      converter.target_spec.experimental_select_user_tf_ops = [
          "CustomAdd4"
      ]
      tflite_model = converter.convert()
  
      self.assertIn(
          "FlexCustomAdd4", tflite_test_util.get_ops_list(tflite_model)
      )
  
imports: import os
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow.core.framework import graph_pb2
  from tensorflow.lite.python import lite
  from tensorflow.lite.python import test_util
  from tensorflow.lite.python.convert import register_custom_opdefs
  from tensorflow.lite.python.interpreter import Interpreter
  from tensorflow.lite.python.testdata import double_op
  from tensorflow.python.client import session
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.framework.importer import import_graph_def
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import list_ops
  from tensorflow.python.ops import nn_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
  from tensorflow.python.saved_model import saved_model
  from tensorflow.python.trackable import autotrackable
label_desc: Use image node_id 2 for calling the WithCustomOpTest obj's underlying member method code with example usage: obj.testFlexWithCustomOp() without return types