class_docstr: A two-stage pipeline, which will run all stages in parallel.
  
  A simple usage:
  ```
      pipeline = Pipeline([
          ("preprocess", preprocess, {}),
          ("inference", model, {}),
      ])
      outputs = pipeline.run(inputs)
  ```
class_docstr_tok: ["A","two-stage","pipeline",",","which","will","run","all","stages","in","parallel",".","A","simple","usage",":","``","`","pipeline","=","Pipeline","(","[","(","``","preprocess","''",",","preprocess",",","{","}",")",",","(","``","inference","''",",","model",",","{","}",")",",","]",")","outputs","=","pipeline.run","(","inputs",")","``","`"]
code: def _launch_stage(
      self, stage: Tuple, recv_: mp.Queue, send_: mp.Queue
  ):
      name, func, config = stage
  
      subprocess_env = {}
      worker_num = config.get("worker_num", 1)
      invalidInputError(
          isinstance(worker_num, int),
          f"worker_num config should input an int value,"
          f" but get {type(worker_num)}",
      )
      process_list = []
  
      cores_per_worker = config.get("cores_per_worker", None)
      for _ in range(worker_num):
          if isinstance(cores_per_worker, int):
              cores = self.cores[:cores_per_worker]
              self.cores = self.cores[cores_per_worker:]
              if len(cores) < cores_per_worker:
                  warnings.warn(
                      f"stage {name} requires {cores_per_worker} cores,"
                      f" but there are only {len(cores)} cores left"
                  )
              subprocess_env["KMP_AFFINITY"] = (
                  f"granularity=fine,proclist"
                  f"=[{','.join([str(i) for i in cores])}],explicit"
              )
              subprocess_env["OMP_NUM_THREADS"] = str(len(cores))
  
          with EnvContext(env=subprocess_env):
              p = mp.Process(
                  target=self._stage_wrapper,
                  args=(func, recv_, send_),
                  daemon=True,
              )
              p.start()
              process_list.append(p)
      return process_list
  
file_path: BigDL/python/nano/src/bigdl/nano/pytorch/inference/pipeline.py
imports: import itertools
  import multiprocessing
  import warnings
  from typing import List, Tuple, Callable
  from bigdl.nano.utils.common import EnvContext
  from bigdl.nano.utils.common import invalidInputError
  from bigdl.nano.utils.common import schedule_workers
  from torch import nn
label_desc: Use image node_id 3 for calling the Pipeline obj's underlying member method code with example usage: obj._launch_stage(stage, recv_, send_) and returns: process_list