code: def _createSavedModelWithCustomOp(self, opname="CustomAdd"):
      custom_opdefs_str = (
          "name: '"
          + opname
          + "' input_arg: {name: 'Input1' type: DT_FLOAT} "
          "input_arg: {name: 'Input2' type: DT_FLOAT} output_arg: {name: "
          "'Output' type: DT_FLOAT}"
      )
  
      # Create a graph that has one add op.
      new_graph = graph_pb2.GraphDef()
      with ops.Graph().as_default():
          with session.Session() as sess:
              in_tensor = array_ops.placeholder(
                  shape=[1, 16, 16, 3],
                  dtype=dtypes.float32,
                  name="input",
              )
              out_tensor = in_tensor + in_tensor
              inputs = {"x": in_tensor}
              outputs = {"z": out_tensor}
  
              new_graph.CopyFrom(sess.graph_def)
  
      # Rename Add op name to opname.
      for node in new_graph.node:
          if node.op.startswith("Add"):
              node.op = opname
              del node.attr["T"]
  
      # Register custom op defs to import modified graph def.
      register_custom_opdefs([custom_opdefs_str])
  
      # Store saved model.
      saved_model_dir = self._getFilepath("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
              )
      return (saved_model_dir, custom_opdefs_str)
  
imports: import os
  from absl.testing import parameterized
  import numpy
  from tensorflow import keras
  from tensorflow.core.framework import graph_pb2
  from tensorflow.lite.python import test_util
  from tensorflow.lite.python import tflite_convert
  from tensorflow.lite.python.convert import register_custom_opdefs
  from tensorflow.python import tf2
  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 random_ops
  from tensorflow.python.platform import gfile
  from tensorflow.python.platform import resource_loader
  from tensorflow.python.platform import test
  from tensorflow.python.saved_model import saved_model
  from tensorflow.python.saved_model.save import save
  from tensorflow.python.trackable import autotrackable
  from tensorflow.python.training.training_util import write_graph
label_desc: Use image node_id 8 for calling the TfLiteConvertV1Test obj's underlying member method code with example usage: obj._createSavedModelWithCustomOp(opname) and returns: saved_model_dir,  custom_opdefs_str