class_docstr: Test accelerator
class_docstr_tok: ["Test","accelerator"]
code: def test_torch(self):
      p = (
          towhee.pipe.input("a")
          .map(("a", "a"), "c", ops.MyTorchOp())
          .output("c")
      )
      self.assertTrue(
          torch.equal(
              p(torch.tensor([1, 2, 3, 4])).get()[0],
              torch.tensor([2, 4, 6, 8]),
          )
      )
  
      def diff(x, y):
          return x - y
  
      pb_utils.InferenceRequest.set_model("diff", diff)
  
      p = (
          towhee.pipe.input("a")
          .map(
              ("a", "a"),
              "c",
              ops.MyTorchOp(),
              config={
                  "acc_info": {
                      "type": "triton",
                      "params": {
                          "model_name": "diff",
                          "inputs": ["a", "b"],
                          "outputs": ["c"],
                      },
                  }
              },
          )
          .output("c")
      )
      self.assertTrue(
          torch.equal(
              p(torch.tensor([1, 2, 3, 4])).get()[0],
              torch.tensor([0, 0, 0, 0]),
          )
      )
  
imports: import unittest
  import torch
  import towhee
  from towhee import ops, register, accelerate
  from towhee.serve.triton.bls.python_backend_wrapper import pb_utils
label_desc: Use image node_id 2 for calling the TestAccelerator obj's underlying member method code with example usage: obj.test_torch() and returns: unknown