class_docstr: An multithreaded online async predictor which runs a list of OnlinePredictor.
  It would do an extra batching internally.
class_docstr_tok: ["An","multithreaded","online","async","predictor","which","runs","a","list","of","OnlinePredictor",".","It","would","do","an","extra","batching","internally","."]
docstr: Args:
      predictors (list): a list of OnlinePredictor available to use.
      batch_size (int): the maximum of an internal batch.
docstr_tok: ["Args",":","predictors","(","list",")",":","a","list","of","OnlinePredictor","available","to","use",".","batch_size","(","int",")",":","the","maximum","of","an","internal","batch","."]
code: def __init__(self, predictors, batch_size=5):
      """
      Args:
          predictors (list): a list of OnlinePredictor available to use.
          batch_size (int): the maximum of an internal batch.
      """
      assert len(predictors)
      self._need_default_sess = False
      for k in predictors:
          assert isinstance(k, OnlinePredictor), type(k)
          if k.sess is None:
              self._need_default_sess = True
          # TODO support predictors.return_input here
          assert not k.return_input
      self.input_queue = queue.Queue(maxsize=len(predictors) * 100)
      self.threads = [
          PredictorWorkerThread(
              self.input_queue, f, id, batch_size=batch_size
          )
          for id, f in enumerate(predictors)
      ]
  
imports: import multiprocessing
  import numpy
  from concurrent.futures import Future
  import tensorflow
  from six.moves import queue, range
  from ..compat import tfv1
  from ..tfutils.model_utils import describe_trainable_vars
  from ..utils import logger
  from ..utils.concurrency import DIE, ShareSessionThread, StoppableThread
  from .base import AsyncPredictorBase, OfflinePredictor, OnlinePredictor
label_desc: Use image node_id 1 to create a new MultiThreadAsyncPredictor object from inherited base classes: AsyncPredictorBase with example: obj = MultiThreadAsyncPredictor(predictors, batch_size)