class_docstr: A callback that runs a list of :class:`Inferencer` on some :class:`InputSource`.
docstr: Args:
      input (InputSource or DataFlow): The :class:`InputSource` to run
          inference on.  If given a DataFlow, will use :class:`FeedInput`.
      infs (list): a list of :class:`Inferencer` instances.
      tower_name (str): the name scope of the tower to build.
          If multiple InferenceRunner are used, each needs a different tower_name.
      tower_func (tfutils.TowerFunc or None): the tower function to be used to build the graph.
          By defaults to call `trainer.tower_func` under a `training=False` TowerContext,
          but you can change it to a different tower function
          if you need to inference with several different graphs.
      device (int): the device to use
docstr_tok: ["Args",":","input","(","InputSource","or","DataFlow",")",":","The",":","class",":","`","InputSource","`","to","run","inference","on",".","If","given","a","DataFlow",",","will","use",":","class",":","`","FeedInput","`",".","infs","(","list",")",":","a","list","of",":","class",":","`","Inferencer","`","instances",".","tower_name","(","str",")",":","the","name","scope","of","the","tower","to","build",".","If","multiple","InferenceRunner","are","used",",","each","needs","a","different","tower_name",".","tower_func","(","tfutils.TowerFunc","or","None",")",":","the","tower","function","to","be","used","to","build","the","graph",".","By","defaults","to","call","`","trainer.tower_func","`","under","a","`","training=False","`","TowerContext",",","but","you","can","change","it","to","a","different","tower","function","if","you","need","to","inference","with","several","different","graphs",".","device","(","int",")",":","the","device","to","use"]
code: def __init__(
      self,
      input,
      infs,
      tower_name="InferenceTower",
      tower_func=None,
      device=0,
  ):
      """
      Args:
          input (InputSource or DataFlow): The :class:`InputSource` to run
              inference on.  If given a DataFlow, will use :class:`FeedInput`.
          infs (list): a list of :class:`Inferencer` instances.
          tower_name (str): the name scope of the tower to build.
              If multiple InferenceRunner are used, each needs a different tower_name.
          tower_func (tfutils.TowerFunc or None): the tower function to be used to build the graph.
              By defaults to call `trainer.tower_func` under a `training=False` TowerContext,
              but you can change it to a different tower function
              if you need to inference with several different graphs.
          device (int): the device to use
      """
      if isinstance(input, DataFlow):
          # use infinite=False so that a dataflow without size will stop normally
          # TODO a better way to handle inference size
          input = FeedInput(input, infinite=False)
      assert isinstance(input, InputSource), input
      assert not isinstance(input, StagingInput), input
      self._tower_name = tower_name
      self._device_id = device
      self._device = _device_from_int(device)
      self._tower_func = tower_func
      super(InferenceRunner, self).__init__(input, infs)
  
imports: import itertools
  import sys
  from contextlib import contextmanager
  import tqdm
  from tensorflow.python.training.monitored_session import _HookedSession
  from ..compat import tfv1
  from ..dataflow.base import DataFlow
  from ..input_source import FeedInput, InputSource, QueueInput, StagingInput
  from ..tfutils.tower import PredictTowerContext
  from ..utils import logger
  from ..utils.utils import get_tqdm_kwargs
  from .base import Callback
  from .group import Callbacks
  from .inference import Inferencer
label_desc: Use image node_id 1 to create a new InferenceRunner object from inherited base classes: InferenceRunnerBase with example: obj = InferenceRunner(input, infs, tower_name, tower_func, device)