class_docstr: test pipeline to triton model
code: def test_normal(self):
      p = (
          towhee.pipe.input("nums", "arr")
          .flat_map("nums", "num", lambda x: x)
          .map(("num", "arr"), "ret", lambda x, y: x + y)
          .output("ret")
      )
  
      with TemporaryDirectory(dir="./") as root:
          self.assertTrue(
              PipeToTriton(
                  p.dag_repr, root, "ut_pipeline", {"parallelism": 4}
              ).process()
          )
          self.assertTrue(
              os.path.isfile(
                  os.path.join(root, "ut_pipeline", "1", "model.py")
              )
          )
          self.assertTrue(
              os.path.isfile(
                  os.path.join(root, "ut_pipeline", "1", "pipe.pickle")
              )
          )
          self.assertTrue(
              os.path.isfile(
                  os.path.join(root, "ut_pipeline", "config.pbtxt")
              )
          )
          module_spec = importlib.util.spec_from_file_location(
              "py_model",
              os.path.join(root, "ut_pipeline", "1", "model.py"),
          )
          module = importlib.util.module_from_spec(module_spec)
          module_spec.loader.exec_module(module)
          pipe = module.TritonPythonModel()
          pipe.initialize({})
  
          input_data = ([1, 2, 3], np.random.rand(3, 3))
          triton_input = np.array(
              [[to_json(input_data)]], dtype=np.object_
          )
          input_tensors = pb_utils.InferenceRequest(
              [pb_utils.Tensor("INPUT0", triton_input)], [], ""
          )
  
          res = pipe.execute([input_tensors])
          ret = from_json(res[0].output_tensors()[0].as_numpy()[0])
          self.assertEqual(len(ret[0]), 3)
          for index, item in enumerate(ret[0], 1):
              self.assertTrue(
                  (item[0] == (input_data[1] + index)).all()
              )
          pipe.finalize()
  
file_path: towhee/tests/unittests/serve/triton/test_pipe_to_triton.py
imports: import os
  import unittest
  import importlib
  from tempfile import TemporaryDirectory
  import numpy
  import towhee
  from towhee.serve.triton.pipe_to_triton import PipeToTriton
  from towhee.utils.serializer import to_json, from_json
  from towhee.serve.triton.bls.python_backend_wrapper import pb_utils
label_desc: Use image node_id 1 for calling the TestPipeToTriton obj's underlying member method code with example usage: obj.test_normal() without return types