diff options
Diffstat (limited to 'config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionShadowingTestCase.java')
-rw-r--r-- | config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionShadowingTestCase.java | 40 |
1 files changed, 5 insertions, 35 deletions
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionShadowingTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionShadowingTestCase.java index ed1b00e2875..5100ac15c40 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionShadowingTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionShadowingTestCase.java @@ -2,10 +2,7 @@ package com.yahoo.searchdefinition; import com.yahoo.collections.Pair; -import com.yahoo.search.query.profile.QueryProfile; import com.yahoo.search.query.profile.QueryProfileRegistry; -import com.yahoo.search.query.profile.types.FieldDescription; -import com.yahoo.search.query.profile.types.QueryProfileType; import com.yahoo.searchdefinition.derived.AttributeFields; import com.yahoo.searchdefinition.derived.RawRankProfile; import com.yahoo.searchdefinition.parser.ParseException; @@ -152,12 +149,11 @@ public class RankingExpressionShadowingTestCase extends SearchDefinitionTestCase censorBindingHash(testRankProperties.get(4).toString())); } + @Test public void testNeuralNetworkSetup() throws ParseException { - // Note: the type assigned to query profile and constant tensors here is not the correct type RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - QueryProfileRegistry queryProfiles = queryProfileWith("query(q)", "tensor(x[])"); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry, queryProfiles); + SearchBuilder builder = new SearchBuilder(rankProfileRegistry); builder.importString( "search test {\n" + " document test { \n" + @@ -180,28 +176,13 @@ public class RankingExpressionShadowingTestCase extends SearchDefinitionTestCase " expression: sum(final_layer)\n" + " }\n" + " }\n" + - " constant W_hidden {\n" + - " type: tensor(x[])\n" + - " file: ignored.json\n" + - " }\n" + - " constant b_input {\n" + - " type: tensor(x[])\n" + - " file: ignored.json\n" + - " }\n" + - " constant W_final {\n" + - " type: tensor(x[])\n" + - " file: ignored.json\n" + - " }\n" + - " constant b_final {\n" + - " type: tensor(x[])\n" + - " file: ignored.json\n" + - " }\n" + + "\n" + "}\n"); builder.build(); Search s = builder.getSearch(); - RankProfile test = rankProfileRegistry.getRankProfile(s, "test").compile(queryProfiles); + RankProfile test = rankProfileRegistry.getRankProfile(s, "test").compile(new QueryProfileRegistry()); List<Pair<String, String>> testRankProperties = new RawRankProfile(test, - queryProfiles, + new QueryProfileRegistry(), new AttributeFields(s)).configProperties(); assertEquals("(rankingExpression(relu).rankingScript,max(1.0,x))", testRankProperties.get(0).toString()); @@ -217,17 +198,6 @@ public class RankingExpressionShadowingTestCase extends SearchDefinitionTestCase testRankProperties.get(5).toString()); } - private QueryProfileRegistry queryProfileWith(String field, String type) { - QueryProfileType queryProfileType = new QueryProfileType("root"); - queryProfileType.addField(new FieldDescription(field, type)); - QueryProfileRegistry queryProfileRegistry = new QueryProfileRegistry(); - queryProfileRegistry.getTypeRegistry().register(queryProfileType); - QueryProfile profile = new QueryProfile("default"); - profile.setType(queryProfileType); - queryProfileRegistry.register(profile); - return queryProfileRegistry; - } - private String censorBindingHash(String s) { StringBuilder b = new StringBuilder(); boolean areInHash = false; |