summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2016-12-04 15:29:32 -0800
committerJon Bratseth <bratseth@yahoo-inc.com>2016-12-04 15:29:32 -0800
commit65190a02569bef23f3c0d3383e4c333f640ef292 (patch)
treec48a11e88141ba1eee7f732fcda27bf97642de27 /config-model
parentee6783f2201988e22ef91d1f354255599c8c0165 (diff)
Towards always typed, fully specified tensors
- Tensor addresses do not repeat dimensions. - Tensor addresses must provide a value for all dimensions. - Tensor dimensions are not serialized in JSON (but still are in binary). - Tensor types are required everywhere, except a workaround for JSON deserialization. - Tensor operations are about 50% faster. - Tensor join of two tensors in the same space is about 4000% faster.
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTensorTestCase.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTensorTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTensorTestCase.java
index f6a7ddd4983..902608c34ba 100644
--- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTensorTestCase.java
+++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTensorTestCase.java
@@ -62,13 +62,13 @@ public class RankingExpressionWithTensorTestCase {
" }\n" +
" constants {\n" +
" my_tensor {\n" +
- " value: { {x:1}:1, {x:2,y:1}:2 }\n" +
+ " value: { {x:1,y:2}:1, {x:2,y:1}:2 }\n" +
" type: tensor(x{},y{})\n" +
" }\n" +
" }\n" +
" }");
f.assertFirstPhaseExpression("reduce(constant(my_tensor), sum)", "my_profile");
- f.assertRankProperty("{{x:1}:1.0,{x:2,y:1}:2.0}", "constant(my_tensor).value", "my_profile");
+ f.assertRankProperty("{{x:1,y:2}:1.0,{x:2,y:1}:2.0}", "constant(my_tensor).value", "my_profile");
f.assertRankProperty("tensor(x{},y{})", "constant(my_tensor).type", "my_profile");
}
@@ -82,7 +82,7 @@ public class RankingExpressionWithTensorTestCase {
" constants {\n" +
" my_tensor {\n" +
" value {\n" +
- " { {x:1}:1,\n" +
+ " { {x:1,y:2}:1,\n" +
" {x:2,y:1}:2 }\n" +
" }\n" +
" type: tensor(x{},y{})\n" +
@@ -90,7 +90,7 @@ public class RankingExpressionWithTensorTestCase {
" }\n" +
" }");
f.assertFirstPhaseExpression("reduce(constant(my_tensor), sum)", "my_profile");
- f.assertRankProperty("{{x:1}:1.0,{x:2,y:1}:2.0}", "constant(my_tensor).value", "my_profile");
+ f.assertRankProperty("{{x:1,y:2}:1.0,{x:2,y:1}:2.0}", "constant(my_tensor).value", "my_profile");
f.assertRankProperty("tensor(x{},y{})", "constant(my_tensor).type", "my_profile");
}