use ReferenceEvaluation instead
#include "array_array_map.h"
#include "function.h"
#include "interpreted_function.h"
-#include "simple_value.h"
#include "tensor.h"
#include "tensor_engine.h"
#include "value.h"
#include "value_codec.h"
#include "value_type.h"
#include <vespa/vespalib/util/stringfmt.h>
+#include <vespa/eval/eval/test/reference_evaluation.h>
#include <vespa/vespalib/data/slime/slime.h>
#include <ostream>
@@ -205,13 +205,9 @@ TensorSpec::from_value(const eval::Value &value)
TensorSpec
TensorSpec::from_expr(const vespalib::string &expr)
{
- NoParams no_params;
auto fun = Function::parse(expr);
if (!fun->has_error() && (fun->num_params() == 0)) {
- NodeTypes node_types(*fun, {});
- InterpretedFunction ifun(SimpleValueBuilderFactory::get(), *fun, node_types);
- InterpretedFunction::Context ctx(ifun);
- return from_value(ifun.eval(ctx, no_params));
+ return test::ReferenceEvaluation::eval(*fun, {});
}
return TensorSpec("error");
}
