summaryrefslogtreecommitdiffstats
path: root/config-model/src/test/java/com/yahoo/schema
diff options
context:
space:
mode:
authorLester Solbakken <lesters@oath.com>2023-09-11 13:06:58 +0200
committerLester Solbakken <lesters@oath.com>2023-09-11 13:06:58 +0200
commit0c6889ebf0a7842c8c943ea54000f2f4055f7795 (patch)
tree9e8c89c9cc9a4b96f90b72300f03a3d803bda9cd /config-model/src/test/java/com/yahoo/schema
parentc38fcd2e6f09273459ade724fd571e615ff3f6c9 (diff)
Add utility function for custom token ids
Diffstat (limited to 'config-model/src/test/java/com/yahoo/schema')
-rw-r--r--config-model/src/test/java/com/yahoo/schema/processing/RankingExpressionWithTransformerTokensTestCase.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/config-model/src/test/java/com/yahoo/schema/processing/RankingExpressionWithTransformerTokensTestCase.java b/config-model/src/test/java/com/yahoo/schema/processing/RankingExpressionWithTransformerTokensTestCase.java
index 5c82be0745e..6cfd7126fff 100644
--- a/config-model/src/test/java/com/yahoo/schema/processing/RankingExpressionWithTransformerTokensTestCase.java
+++ b/config-model/src/test/java/com/yahoo/schema/processing/RankingExpressionWithTransformerTokensTestCase.java
@@ -37,6 +37,17 @@ public class RankingExpressionWithTransformerTokensTestCase {
}
@Test
+ void testTokenInputIdsCustomPadTokens() throws Exception {
+ String expected = "tensor(d0[1],d1[13]):[1,11,12,2,13,14,15,2,16,17,2,0,0]";
+ String a = "tensor(d0[2]):[11,12]";
+ String b = "tensor(d0[3]):[13,14,15]";
+ String c = "tensor(d0[2]):[16,17]";
+ String expression = "customTokenInputIds(1, 2, 13, a, b, c)";
+ Tensor result = evaluateExpression(expression, a, b, c);
+ assertEquals(Tensor.from(expected), result);
+ }
+
+ @Test
void testTokenTypeIds() throws Exception {
String expected = "tensor(d0[1],d1[10]):[0,0,0,0,1,1,1,1,0,0]";
String a = "tensor(d0[2]):[1,2]";