private ExpressionNode transformConstantReference(ReferenceNode node, RankProfileTransformContext context) {
        String constantName = node.getName();
        Reference constantReference = node.reference();
        if (FeatureNames.isConstantFeature(constantReference)) {
            constantName = constantReference.simpleArgument().orElse(null);
        } else if (constantReference.isIdentifier()) {
            constantReference = FeatureNames.asConstantFeature(constantName);
        } else {
            return node;
        }
        Value value = context.constants().get(constantName);
        if (value == null || value.type().rank() == 0) return node;

        TensorValue tensorValue = (TensorValue)value;
        String tensorType = tensorValue.asTensor().type().toString();
        context.rankProperties().put(constantReference + ".value", tensorValue.toString());
        context.rankProperties().put(constantReference + ".type", tensorType);
        return new ReferenceNode(constantReference);
    }
Transforms named references to constant tensors with the rank feature 'constant'.

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