void fillOutputTypes(Map<String, OnnxEvaluator.IdAndType> outputTypes) {
        if (outputSpecs.isEmpty()) {
            for (var entry : outputTypes.entrySet()) {
                String name = entry.getKey();
                String as = entry.getValue().id();
                TensorType tType = entry.getValue().type();
                var spec = new OutputSpec(name, as, tType);
                outputSpecs.add(spec);
            }
        } else {
            if (outputTypes.size() != outputSpecs.size()) {
                throw new IllegalArgumentException("Onnx model " + name() +
                                                   ": Mismatch between " + outputSpecs.size() +
                                                   " configured outputs and " +
                                                   outputTypes.size() + " actual model outputs");
            }
            for (var spec : outputSpecs) {
                var entry = outputTypes.get(spec.onnxName);
                if (entry == null) {
                    throw new IllegalArgumentException("Onnx model " + name() +
                                                       ": No type in actual model for configured output "
                                                       + spec.onnxName);
                }
                spec.expectedType = entry.type();
            }
        }
    }
A named ONNX model that should be evaluated with OnnxEvaluator.

@author lesters
model-evaluation/src/main/java/ai/vespa/models/evaluation/OnnxModel.java