Correct – ModelRunner does not accept input. It assumes a model with no inputs and a single output.


I would guess that I would have to write my own input handler. Where would I do that?
Relating to 2, is there a high level class that I can subclass from to create my own builder?
Ultimately, is there a barebones example somewhere?


You’d need to create your own version that uses a specific number of inputs/outputs given your use case, as well as load the inputs yourself into the input tensors. I think the most barebones example we have is ModelRunner. You then could look to ImageClassifier to observe how we are loading in inputs and outputs. TextTranslator also exhibits multiple inputs and outputs for a model. I.e. for each, you can take a look at calls to create Caffe2ModelLoader/ONNXModelLoader to see how to use multiple inputs/outputs, how they’re used later, etc.

Since model-runner does not accept input, how does it perform quantization (if asked) and other optimizations?

Good question – it would only be able to quantize given the Constant inputs already specified. However, the ModelRunner is really there as a simple tester for operator support, and is not used for serious models where you would want to gather a profile across many different inputs and then test accuracy across some test set.