protected static ImportedModel convertIntermediateGraphToModel(IntermediateGraph graph,
                                                                   String modelSource,
                                                                   ImportedMlModel.ModelType modelType) {
        ImportedModel model = new ImportedModel(graph.name(), modelSource, modelType);
        log.log(Level.FINER, () -> "Intermediate graph created from '" + modelSource + "':\n" +
                                   ExpressionFormatter.inTwoColumnMode(70, 50).format(graph.toFullString()));

        graph.optimize();

        importSignatures(graph, model);
        importExpressions(graph, model);
        reportWarnings(graph, model);
        logVariableTypes(graph);

        return model;
    }
Takes an IntermediateGraph and converts it to a ImportedModel containing
the actual Vespa ranking expressions.
model-integration/src/main/java/ai/vespa/rankingexpression/importer/ModelImporter.java