Implement a custom ONNX configuration.
Export the model to ONNX.
Validate the outputs of the PyTorch and exported models.
In this section, we'll look at how DistilBERT was implemented to show what's
involved with each step.
Implementing a custom ONNX configuration
Let's start with the ONNX configuration object. We provide three abstract
classes that you should inherit from, depending on the type of model
architecture you wish to export:
Encoder-based models inherit from [~onnx.config.OnnxConfig]
Decoder-based models inherit from [~onnx.config.OnnxConfigWithPast]
Encoder-decoder models inherit from [~onnx.config.OnnxSeq2SeqConfigWithPast]
A good way to implement a custom ONNX configuration is to look at the existing
implementation in the configuration_<model_name>.py file of a similar architecture.
