summaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java
diff options
context:
space:
mode:
authorLester Solbakken <lesters@oath.com>2020-04-29 15:26:01 +0200
committerLester Solbakken <lesters@oath.com>2020-04-29 15:26:01 +0200
commit95adeaad585d24b92001d7ef5b1a7825cb84b8a5 (patch)
tree52dcec6a873b2ded8907c4308bd59e7e81c6fe12 /config-model/src/main/java
parenta8fc679943ae9bdc6d6d58d82a2b9f43dac54ad4 (diff)
Revert "Add method to fetch constants as tensors"
This reverts commit 0d0de85cc0b9f280f91a992a015b323f7c9666da.
Diffstat (limited to 'config-model/src/main/java')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/ml/ConvertedModel.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/ml/ConvertedModel.java b/config-model/src/main/java/com/yahoo/vespa/model/ml/ConvertedModel.java
index 33b1e9c654c..c3d6f457ce8 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/ml/ConvertedModel.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/ml/ConvertedModel.java
@@ -209,8 +209,8 @@ public class ConvertedModel {
ModelStore store) {
// Add constants
Set<String> constantsReplacedByFunctions = new HashSet<>();
- model.smallConstantValues().forEach((k, v) -> transformSmallConstant(store, profile, k, v));
- model.largeConstantValues().forEach((k, v) -> transformLargeConstant(store, profile, queryProfiles,
+ model.smallConstants().forEach((k, v) -> transformSmallConstant(store, profile, k, v));
+ model.largeConstants().forEach((k, v) -> transformLargeConstant(store, profile, queryProfiles,
constantsReplacedByFunctions, k, v));
// Add functions
@@ -283,7 +283,8 @@ public class ConvertedModel {
}
private static void transformSmallConstant(ModelStore store, RankProfile profile, String constantName,
- Tensor constantValue) {
+ String constantValueString) {
+ Tensor constantValue = Tensor.from(constantValueString);
store.writeSmallConstant(constantName, constantValue);
profile.addConstant(constantName, asValue(constantValue));
}
@@ -293,7 +294,8 @@ public class ConvertedModel {
QueryProfileRegistry queryProfiles,
Set<String> constantsReplacedByFunctions,
String constantName,
- Tensor constantValue) {
+ String constantValueString) {
+ Tensor constantValue = Tensor.from(constantValueString);
RankProfile.RankingExpressionFunction rankingExpressionFunctionOverridingConstant = profile.getFunctions().get(constantName);
if (rankingExpressionFunctionOverridingConstant != null) {
TensorType functionType = rankingExpressionFunctionOverridingConstant.function().getBody().type(profile.typeContext(queryProfiles));