The C++ code for loading the exported TensorFlow model is in the main()
function in mnist_inference.cc
. Here we report an excerpt; we do not consider the parameters for batching. If you want to adjust the maximum batch size, timeout threshold, or the number of background threads used for batched inference, you can do so by setting more values in BatchingParameters
:
int main(int argc, char** argv) { SessionBundleConfig session_bundle_config; . . . Here batching parameters std::unique_ptr<SessionBundleFactory> bundle_factory; TF_QCHECK_OK( SessionBundleFactory::Create(session_bundle_config, &bundle_factory)); std::unique_ptr<SessionBundle> bundle(new SessionBundle); TF_QCHECK_OK(bundle_factory->CreateSessionBundle(bundle_path, &bundle)); ...... RunServer(FLAGS_port, std::move(bundle...