code: def testFlexMode(self, enable_mlir):
      with ops.Graph().as_default():
          in_tensor = array_ops.placeholder(
              shape=[1, 4], dtype=dtypes.float32
          )
          out_tensor = in_tensor + in_tensor
          sess = session.Session()
  
      # Convert model and ensure model is not None.
      converter = lite.TFLiteConverter.from_session(
          sess, [in_tensor], [out_tensor]
      )
      converter.target_spec.supported_ops = set(
          [lite.OpsSet.SELECT_TF_OPS]
      )
      converter.experimental_new_converter = enable_mlir
      tflite_model = converter.convert()
      self.assertTrue(tflite_model)
  
      # Check the model works with TensorFlow ops.
      interpreter = Interpreter(model_content=tflite_model)
      interpreter.allocate_tensors()
      input_details = interpreter.get_input_details()
      test_input = np.array([[1.0, 2.0, 3.0, 4.0]], dtype=np.float32)
      interpreter.set_tensor(input_details[0]["index"], test_input)
      interpreter.invoke()
  
      output_details = interpreter.get_output_details()
      expected_output = np.array(
          [[2.0, 4.0, 6.0, 8.0]], dtype=np.float32
      )
      output_data = interpreter.get_tensor(output_details[0]["index"])
      self.assertTrue((expected_output == output_data).all())
  
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 1 for calling the FromSessionTest obj's underlying member method code with example usage: obj.testFlexMode(enable_mlir) without return types