aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/test
diff options
context:
space:
mode:
authorArne Juul <arnej@vespa.ai>2023-11-05 12:20:09 +0000
committerArne Juul <arnej@yahooinc.com>2023-11-10 09:55:58 +0000
commit65047e9ad4d6138570e141159941ad9b81fdd41b (patch)
tree8c7a5a87be48dae2ce862061e87209129b432ebd /searchlib/src/test
parent83b1ccd36dd5df2e43307aab19adc07b41c94c9f (diff)
add "unpack_bits_from_int8" function
Diffstat (limited to 'searchlib/src/test')
-rw-r--r--searchlib/src/test/java/com/yahoo/searchlib/rankingexpression/evaluation/EvaluationTestCase.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/searchlib/src/test/java/com/yahoo/searchlib/rankingexpression/evaluation/EvaluationTestCase.java b/searchlib/src/test/java/com/yahoo/searchlib/rankingexpression/evaluation/EvaluationTestCase.java
index 637e9be5fc3..6ac734e8771 100644
--- a/searchlib/src/test/java/com/yahoo/searchlib/rankingexpression/evaluation/EvaluationTestCase.java
+++ b/searchlib/src/test/java/com/yahoo/searchlib/rankingexpression/evaluation/EvaluationTestCase.java
@@ -177,6 +177,28 @@ public class EvaluationTestCase {
}
@Test
+ public void testUnpack() {
+ EvaluationTester tester = new EvaluationTester();
+ tester.assertEvaluates("tensor<float>(a{},x[16]):{foo:[" +
+ "0,0,0,0, 0,0,0,0," +
+ "1,1,1,1, 1,1,1,1" +
+ "],bar:[" +
+ "0,0,0,0, 0,0,0,1," +
+ "1,1,1,1, 1,0,0,0]}",
+ "unpack_bits_from_int8(tensor0, float, big)",
+ "tensor<int8>(a{},x[2]):{foo:[0,255],bar:[1,-8]}");
+
+ tester.assertEvaluates("tensor<int8>(a{},x[16]):{foo:[" +
+ "0,0,0,0, 0,0,0,0," +
+ "1,1,1,1, 1,1,1,1" +
+ "],bar:[" +
+ "1,0,0,0, 0,0,0,0," +
+ "0,0,0,1, 1,1,1,1]}",
+ "unpack_bits_from_int8(tensor0, int8, little)",
+ "tensor<int8>(a{},x[2]):{foo:[0,255],bar:[1,-8]}");
+ }
+
+ @Test
public void testMapSubspaces() {
EvaluationTester tester = new EvaluationTester();
tester.assertEvaluates("tensor<float>(a{},x[2]):{foo:[2,3],bar:[7,10]}",