def __init__(self, config, input_source):
        """
        Args:
            config (PredictConfig): the config to use.
            input_source (InputSource): the feedfree InputSource to use.
                Must match the signature of the tower function in config.
        """
        self._config = config
        self._input_source = input_source
        assert config.return_input is False, \
            "return_input is not supported in FeedfreePredictor! " \
            "If you need to fetch inputs, add the names to the output_names!"

        self._hooks = []
        self.graph = config._maybe_create_graph()
        with self.graph.as_default():
            self._input_callbacks = Callbacks(
                self._input_source.setup(config.input_signature))
            with PredictTowerContext(''):
                self._input_tensors = self._input_source.get_input_tensors()
                config.tower_func(*self._input_tensors)
                self._tower_handle = config.tower_func.towers[-1]

            self._output_tensors = self._tower_handle.get_tensors(config.output_names)

            self._input_callbacks.setup_graph(None)

            for h in self._input_callbacks.get_hooks():
                self._register_hook(h)
            self._initialize_session()

        Args:
            config (PredictConfig): the config to use.
            input_source (InputSource): the feedfree InputSource to use.
                Must match the signature of the tower function in config.
        
tensorpack/predict/feedfree.py