C-API Inference Library

After we train a neural network, we use it to do inference. Inference is the process of preparing input data and propagating it through the model to produce the result.

Compared with model training, prediction has the following features:

  1. Inference does not require backpropagation and parameter updates, as required during training.
  2. Labels are not needed in prediction.
  3. Most of the time, predictions need to be integrated with the user system.

Therefore, the model prediction SDK needs to be designed separately and has the following features:

  1. The predictive SDK does not include backpropagation and parameter updates to reduce the size of the SDK.
  2. The predictive SDK needs a simple user interface for ease of use.
  3. Since the input data may have a variety of structures, the format of the input data is clearly and compactly packaged.
  4. In order to be compatible with user’s system, the SDK’s interface must conform to the C-standard interface.

PaddlePaddle provides C-API to solve the above problem. Following are the guidelines to use the C-API: