diff options
author | Jon Bratseth <bratseth@gmail.com> | 2023-03-07 15:23:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-07 15:23:45 +0100 |
commit | 56057c40b54fc5b031ab9c2bfea9450e0ee77993 (patch) | |
tree | 956656920d38c4f508a19bfa5cd222c263ae9123 /model-evaluation/src | |
parent | 0d569d1ba3661484b3d30c94dadae9d0444ffe98 (diff) | |
parent | 1197f63fe1a32b3e17493c9387527ac1c4e40cff (diff) |
Merge pull request #26338 from vespa-engine/arnej/declare-more-function-return-types
Arnej/declare more function return types
Diffstat (limited to 'model-evaluation/src')
-rw-r--r-- | model-evaluation/src/main/java/ai/vespa/models/evaluation/RankProfilesConfigImporter.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/model-evaluation/src/main/java/ai/vespa/models/evaluation/RankProfilesConfigImporter.java b/model-evaluation/src/main/java/ai/vespa/models/evaluation/RankProfilesConfigImporter.java index 8c520e87001..76869932a3e 100644 --- a/model-evaluation/src/main/java/ai/vespa/models/evaluation/RankProfilesConfigImporter.java +++ b/model-evaluation/src/main/java/ai/vespa/models/evaluation/RankProfilesConfigImporter.java @@ -129,11 +129,15 @@ public class RankProfilesConfigImporter { referencedFunctions.put(argReference, function); } else if (returnType.isPresent()) { // Return type always follows the function in properties - ExpressionFunction function = referencedFunctions.get(returnType.get()); - function = function.withReturnType(TensorType.fromSpec(property.value())); - if (returnType.get().isFree()) - functions.put(returnType.get(), function); - referencedFunctions.put(returnType.get(), function); + FunctionReference functionRef = returnType.get(); + ExpressionFunction function = referencedFunctions.get(functionRef); + TensorType type = TensorType.fromSpec(property.value()); + function = function.withReturnType(type); + if (functionRef.isFree()) + functions.put(functionRef, function); + referencedFunctions.put(functionRef, function); + declaredTypes.put(function.getName(), type); // "foo" + declaredTypes.put(functionRef.serialForm(), type); // "rankingExpression(foo)" } else if (property.name().equals("vespa.rank.firstphase")) { // Include in addition to functions firstPhase = new ExpressionFunction("firstphase", new ArrayList<>(), |