'Args:
config (PredictConfig): the config to use.
towers: a list of relative GPU id.'

def __init__(self, config, towers):

    self.graph = config._maybe_create_graph()
    with self.graph.as_default():
        input_tensors = []
        output_tensors = []
        factory = PredictorFactory(config.model, towers)
        for (idx, t) in enumerate(towers):
            tower_name = ('tower' + str(t))
            device = ('/gpu:' + str(t))
            input = PlaceholderInput((tower_name + '/'))
            input.setup(config.model.get_inputs_desc())
            with tf.variable_scope(tf.get_variable_scope(), reuse=(idx > 0)):
                h = factory.build(tower_name, device)
                input_tensors.extend(h.get_tensors(config.input_names))
                output_tensors.extend(h.get_tensors(config.output_names))
        sess = config.session_creator.create_session()
        config.session_init.init(sess)
        super(DataParallelOfflinePredictor, self).__init__(input_tensors, output_tensors, config.return_input, sess)
