def make_run_inference(session, model):
    """Make run_inference() function for given session and model."""

    def run_inference(state_batch):
        """Run inference on a given state_batch. Returns a q value batch."""
        return session.run(model.q_values, feed_dict={model.state_batch_placeholder: state_batch})

    return run_inference