'Args:
tower (int): use device \'/gpu:{tower}\' or use -1 for \'/cpu:0\'.
Returns:
an online predictor (which has to be used under a default session)'

def get_predictor(self, input_names, output_names, tower):

    tower_name = 'towerp{}'.format(tower)
    device = ('/gpu:{}'.format(tower) if (tower >= 0) else '/cpu:0')
    if (tower_name not in self._names_built):
        with tf.variable_scope(self._vs_name, reuse=True):
            handle = self.build(tower_name, device)
    else:
        handle = self._names_built[tower_name]
    in_tensors = handle.get_tensors(input_names)
    out_tensors = handle.get_tensors(output_names)
    from ..predict import OnlinePredictor
    return OnlinePredictor(in_tensors, out_tensors)
