code: def test_all(self):
      # train and eval
      solver = RawNLUJointSolver(self.config)
      solver.train_and_eval()
      model_path = solver.get_generated_model_path()
      self.assertNotEqual(model_path, None)
  
      # infer
      solver.first_eval = True
      solver.infer()
      intent_res_file = self.config["solver"]["postproc"][0].get(
          "res_file", ""
      )
      slots_res_file = self.config["solver"]["postproc"][1].get(
          "res_file", ""
      )
      self.assertTrue(os.path.exists(intent_res_file))
      self.assertTrue(os.path.exists(slots_res_file))
  
      # export model
      solver.export_model()
  
      export_path_base = self.config["solver"]["service"]["model_path"]
      model_version = self.config["solver"]["service"]["model_version"]
      export_path = os.path.join(
          tf.compat.as_bytes(export_path_base),
          tf.compat.as_bytes(model_version),
      )
      export_path = os.path.abspath(export_path)
      logging.info("Load exported model from: {}".format(export_path))
  
      # load the model and run
      graph = tf.Graph()
      with graph.as_default():  # pylint: disable=not-context-manager
          with self.cached_session(
              use_gpu=False, force_gpu=False
          ) as sess:
              tf.saved_model.loader.load(
                  sess,
                  [tf.saved_model.tag_constants.SERVING],
                  export_path,
              )
  
              input_sentence_tensor = graph.get_operation_by_name(
                  "input_sentence"
              ).outputs[0]
  
              intent_score_tensor = graph.get_operation_by_name(
                  "intent_score"
              ).outputs[0]
              slots_score_tensor = graph.get_operation_by_name(
                  "slots_score"
              ).outputs[0]
  
              score = sess.run(
                  [intent_score_tensor, slots_score_tensor],
                  feed_dict={
                      input_sentence_tensor: ["I am happy in the KFC"]
                  },
              )
              logging.info("score: {}".format(score))
  
file_path: delta/delta/utils/solver/raw_nlu_joint_solver_test.py
imports: import os
  from pathlib import Path
  from absl import logging
  import delta.compat
  from delta import utils
  from delta.utils.solver.raw_nlu_joint_solver import RawNLUJointSolver
  from delta.utils.register import import_all_modules_for_register
  from delta import PACKAGE_ROOT_DIR
label_desc: Use image node_id 2 for calling the RawNLUJointSolverTest obj's underlying member method code with example usage: obj.test_all() without return types