private ExpressionNode transformFeature(ReferenceNode node, RankProfileTransformContext context) {
        Reference ref = node.reference();
        String name = ref.name();
        var args = ref.arguments();
        if (name.equals("onnx") && args.size() == 1) {
            var arg = args.expressions().get(0);
            var models = context.rankProfile().onnxModels();
            var model = models.get(arg.toString());
            if (model != null) {
                for (var entry : model.getInputMap().entrySet()) {
                    String source = entry.getValue();
                    var reader = new StringReader(source);
                    try {
                        var asExpression = new RankingExpression(reader);
                        String transformed = transform(asExpression.getRoot(), context).toString();
                        if (! source.equals(transformed)) {
                            // not sure about this:
                            throw new IllegalStateException("unexpected rewrite: " + source + " => " + transformed + " for onnx input " + entry.getKey());
                            // consider instead: model.addInputNameMapping(entry.getKey(), transformed, true);
                        }
                    } catch (ParseException e) {
                        throw new IllegalArgumentException("illegal onnx input '" + source + "': " + e.getMessage());
                    }
                }
                return node;
            }
        }
        if ( ! node.getArguments().isEmpty() && ! FeatureNames.isSimpleFeature(node.reference())) {
            return transformArguments(node, context);
        } else {
            return transformConstantReference(node, context);
        }
    }
Transforms named references to constant tensors with the rank feature 'constant'.

@author geirst
config-model/src/main/java/com/yahoo/schema/expressiontransforms/ConstantTensorTransformer.java