diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-11-04 11:11:16 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-11-04 11:11:16 +0000 |
commit | 232cabbcc81937d34e338570e3793e693855d8fd (patch) | |
tree | c701e1e4eabb778453f3fc61203ccb081df94a1e /config-model/src/main/java/com/yahoo/vespa/model/ml | |
parent | 2eac627b977bf6162b363d8466fe2465a24f46dc (diff) |
Avoid converting tensor to strings and back again.
Diffstat (limited to 'config-model/src/main/java/com/yahoo/vespa/model/ml')
-rw-r--r-- | config-model/src/main/java/com/yahoo/vespa/model/ml/ConvertedModel.java | 6 |
1 files changed, 2 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 9ba87fd24bf..2344d3d15e0 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 @@ -294,8 +294,7 @@ public class ConvertedModel { } private static void transformSmallConstant(ModelStore store, RankProfile profile, String constantName, - String constantValueString) { - Tensor constantValue = Tensor.from(constantValueString); + Tensor constantValue) { store.writeSmallConstant(constantName, constantValue); Reference name = FeatureNames.asConstantFeature(constantName); profile.add(new RankProfile.Constant(name, constantValue)); @@ -306,8 +305,7 @@ public class ConvertedModel { QueryProfileRegistry queryProfiles, Set<String> constantsReplacedByFunctions, String constantName, - String constantValueString) { - Tensor constantValue = Tensor.from(constantValueString); + Tensor constantValue) { RankProfile.RankingExpressionFunction rankingExpressionFunctionOverridingConstant = profile.getFunctions().get(constantName); if (rankingExpressionFunctionOverridingConstant != null) { TensorType functionType = rankingExpressionFunctionOverridingConstant.function().getBody().type(profile.typeContext(queryProfiles)); |