Search in sources :

Example 6 with MapContext

use of com.yahoo.searchlib.rankingexpression.evaluation.MapContext in project vespa by vespa-engine.

the class TensorConformanceTest method getInput.

private MapContext getInput(JsonNode inputs) {
    MapContext context = new MapContext();
    for (Iterator<String> i = inputs.fieldNames(); i.hasNext(); ) {
        String name = i.next();
        String value = inputs.get(name).asText();
        Tensor tensor = getTensor(value);
        context.put(name, new TensorValue(tensor));
    }
    return context;
}
Also used : TensorValue(com.yahoo.searchlib.rankingexpression.evaluation.TensorValue) Tensor(com.yahoo.tensor.Tensor) MapContext(com.yahoo.searchlib.rankingexpression.evaluation.MapContext)

Aggregations

MapContext (com.yahoo.searchlib.rankingexpression.evaluation.MapContext)6 RankingExpression (com.yahoo.searchlib.rankingexpression.RankingExpression)3 ArrayContext (com.yahoo.searchlib.rankingexpression.evaluation.ArrayContext)2 OptimizationReport (com.yahoo.searchlib.rankingexpression.evaluation.OptimizationReport)2 TensorValue (com.yahoo.searchlib.rankingexpression.evaluation.TensorValue)2 Tensor (com.yahoo.tensor.Tensor)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 Context (com.yahoo.searchlib.rankingexpression.evaluation.Context)1 ExpressionOptimizer (com.yahoo.searchlib.rankingexpression.evaluation.ExpressionOptimizer)1 ParseException (com.yahoo.searchlib.rankingexpression.parser.ParseException)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 Test (org.junit.Test)1