use of com.yahoo.searchlib.rankingexpression.evaluation.TensorValue in project vespa by vespa-engine.
the class TestableTensorFlowModel method assertEqualResult.
public void assertEqualResult(String inputName, String operationName) {
Tensor tfResult = tensorFlowExecute(tensorFlowModel, inputName, operationName);
Context context = contextFrom(model);
Tensor placeholder = placeholderArgument();
context.put(inputName, new TensorValue(placeholder));
model.macros().forEach((k, v) -> evaluateMacro(context, model, k));
Tensor vespaResult = model.expressions().get(operationName).evaluate(context).asTensor();
assertEquals("Operation '" + operationName + "' produces equal results", tfResult, vespaResult);
}
use of com.yahoo.searchlib.rankingexpression.evaluation.TensorValue 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;
}
Aggregations