Add parser support

You must add parser functionality and unit tests to enable support for your required parsers.

Add parser functionality

Add parser functionality to the corresponding parser. For example, add parser functionality for the TensorFlow, TensorFlow Lite, Caffe, or ONNX parsers.

Arm NN includes the following parser libraries in armnn/src:

  • The armnnCaffeParser is a library for loading neural networks that are defined in Caffe protobuf files, into the Arm NN runtime.
  • The armnnTfParser is a library for loading neural networks that TensorFlow protobuf files define, into the Arm NN runtime.
  • The armnnTfLiteParser is a library for loading neural networks that TensorFlow Lite FlatBuffers, define, into the Arm NN runtime.
  • The armnnOnnxParser is a library for loading neural networks that are defined in ONNX protobuf files, into the Arm NN runtime.

To add new layer support for those parsers:

  1. Declare the Parse<LayerName>() function in <X_Parser>.hpp.
  2. Implement the body of the Parse<LayerName>() in <X_Parser>.cpp.

Add parser unit tests

You can add parser unit tests to the new operator to test and verify that the parsing functionality of the new operator works. The parser unit test must contain a JSON representation of a simple network that contains an input layer and the expected output values. For example, inputLayer→<newLayer>→outputLayer.

The parser unit test infrastructure parses the network graph into an Arm NN format, then executes and compares the output values with the expected output values.

The parser unit tests are in armnn/src/armm<X_Parser>/test.

Previous Next