class_docstr: A predictor which directly use an existing session and given tensors.
  
  Attributes:
      sess: The tf.Session object associated with this predictor.
docstr: Args:
      input_tensors (list): list of names.
      output_tensors (list): list of names.
      return_input (bool): same as :attr:`PredictorBase.return_input`.
      sess (tf.Session): the session this predictor runs in. If None,
          will use the default session at the first call.
          Note that in TensorFlow, default session is thread-local.
docstr_tok: ["Args",":","input_tensors","(","list",")",":","list","of","names",".","output_tensors","(","list",")",":","list","of","names",".","return_input","(","bool",")",":","same","as",":","attr",":","`","PredictorBase.return_input","`",".","sess","(","tf.Session",")",":","the","session","this","predictor","runs","in",".","If","None",",","will","use","the","default","session","at","the","first","call",".","Note","that","in","TensorFlow",",","default","session","is","thread-local","."]
code: def __init__(
      self, input_tensors, output_tensors, return_input=False, sess=None
  ):
      """
      Args:
          input_tensors (list): list of names.
          output_tensors (list): list of names.
          return_input (bool): same as :attr:`PredictorBase.return_input`.
          sess (tf.Session): the session this predictor runs in. If None,
              will use the default session at the first call.
              Note that in TensorFlow, default session is thread-local.
      """
  
      def normalize_name(t):
          if isinstance(t, six.string_types):
              return get_op_tensor_name(t)[1]
          return t
  
      self.return_input = return_input
      self.input_tensors = [normalize_name(x) for x in input_tensors]
      self.output_tensors = [normalize_name(x) for x in output_tensors]
      self.sess = sess
  
      if sess is not None:
          self._callable = sess.make_callable(
              fetches=output_tensors,
              feed_list=input_tensors,
              accept_options=self.ACCEPT_OPTIONS,
          )
      else:
          self._callable = None
  
imports: from abc import ABCMeta, abstractmethod
  import six
  import tensorflow
  from ..input_source import PlaceholderInput
  from ..tfutils.common import get_tensors_by_names, get_op_tensor_name
  from ..tfutils.tower import PredictTowerContext
label_desc: Use image node_id 1 to create a new OnlinePredictor object from inherited base classes: PredictorBase with example: obj = OnlinePredictor(input_tensors, output_tensors, return_input, sess)