aboutsummaryrefslogtreecommitdiffstats
path: root/eval
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2020-12-03 15:05:32 +0000
committerArne Juul <arnej@verizonmedia.com>2020-12-04 10:34:13 +0000
commitbc8e2b66e21946c15e92703c6ef38c21917abd28 (patch)
tree25354d28ace13560cd7bb24c8edf98711f5b0729 /eval
parent85216dbf7f8cc9e5f434796331246ba9b0ae8ab0 (diff)
DenseTensorView -> DenseValueView
Diffstat (limited to 'eval')
-rw-r--r--eval/src/tests/tensor/onnx_wrapper/onnx_wrapper_test.cpp28
-rw-r--r--eval/src/vespa/eval/instruction/dense_lambda_peek_function.cpp2
-rw-r--r--eval/src/vespa/eval/instruction/dense_matmul_function.cpp6
-rw-r--r--eval/src/vespa/eval/instruction/dense_multi_matmul_function.cpp5
-rw-r--r--eval/src/vespa/eval/instruction/dense_simple_expand_function.cpp2
-rw-r--r--eval/src/vespa/eval/instruction/dense_xw_product_function.cpp7
-rw-r--r--eval/src/vespa/eval/instruction/generic_concat.cpp2
-rw-r--r--eval/src/vespa/eval/tensor/dense/dense_replace_type_function.cpp5
-rw-r--r--eval/src/vespa/eval/tensor/dense/dense_simple_join_function.cpp9
-rw-r--r--eval/src/vespa/eval/tensor/dense/dense_simple_map_function.cpp9
-rw-r--r--eval/src/vespa/eval/tensor/dense/dense_single_reduce_function.cpp4
-rw-r--r--eval/src/vespa/eval/tensor/dense/dense_tensor_create_function.cpp3
-rw-r--r--eval/src/vespa/eval/tensor/dense/onnx_wrapper.cpp7
-rw-r--r--eval/src/vespa/eval/tensor/dense/vector_from_doubles_function.cpp8
14 files changed, 52 insertions, 45 deletions
diff --git a/eval/src/tests/tensor/onnx_wrapper/onnx_wrapper_test.cpp b/eval/src/tests/tensor/onnx_wrapper/onnx_wrapper_test.cpp
index efab0571e62..3cd7f697067 100644
--- a/eval/src/tests/tensor/onnx_wrapper/onnx_wrapper_test.cpp
+++ b/eval/src/tests/tensor/onnx_wrapper/onnx_wrapper_test.cpp
@@ -136,17 +136,17 @@ TEST(OnnxTest, simple_onnx_model_can_be_evaluated)
ValueType query_type = ValueType::from_spec("tensor<float>(a[1],b[4])");
std::vector<float> query_values({1.0, 2.0, 3.0, 4.0});
- DenseTensorView query(query_type, TypedCells(query_values));
+ DenseValueView query(query_type, TypedCells(query_values));
EXPECT_TRUE(planner.bind_input_type(query_type, model.inputs()[0]));
ValueType attribute_type = ValueType::from_spec("tensor<float>(a[4],b[1])");
std::vector<float> attribute_values({5.0, 6.0, 7.0, 8.0});
- DenseTensorView attribute(attribute_type, TypedCells(attribute_values));
+ DenseValueView attribute(attribute_type, TypedCells(attribute_values));
EXPECT_TRUE(planner.bind_input_type(attribute_type, model.inputs()[1]));
ValueType bias_type = ValueType::from_spec("tensor<float>(a[1],b[1])");
std::vector<float> bias_values({9.0});
- DenseTensorView bias(bias_type, TypedCells(bias_values));
+ DenseValueView bias(bias_type, TypedCells(bias_values));
EXPECT_TRUE(planner.bind_input_type(bias_type, model.inputs()[2]));
EXPECT_EQ(planner.make_output_type(model.outputs()[0]).to_spec(),
@@ -168,7 +168,7 @@ TEST(OnnxTest, simple_onnx_model_can_be_evaluated)
EXPECT_EQ(GetCell::from(cells, 0), 79.0);
//-------------------------------------------------------------------------
std::vector<float> new_bias_values({10.0});
- DenseTensorView new_bias(bias_type, TypedCells(new_bias_values));
+ DenseValueView new_bias(bias_type, TypedCells(new_bias_values));
ctx.bind_param(2, new_bias);
ctx.eval();
EXPECT_EQ(GetCell::from(output.cells(), 0), 80.0);
@@ -182,17 +182,17 @@ TEST(OnnxTest, dynamic_onnx_model_can_be_evaluated)
ValueType query_type = ValueType::from_spec("tensor<float>(a[1],b[4])");
std::vector<float> query_values({1.0, 2.0, 3.0, 4.0});
- DenseTensorView query(query_type, TypedCells(query_values));
+ DenseValueView query(query_type, TypedCells(query_values));
EXPECT_TRUE(planner.bind_input_type(query_type, model.inputs()[0]));
ValueType attribute_type = ValueType::from_spec("tensor<float>(a[4],b[1])");
std::vector<float> attribute_values({5.0, 6.0, 7.0, 8.0});
- DenseTensorView attribute(attribute_type, TypedCells(attribute_values));
+ DenseValueView attribute(attribute_type, TypedCells(attribute_values));
EXPECT_TRUE(planner.bind_input_type(attribute_type, model.inputs()[1]));
ValueType bias_type = ValueType::from_spec("tensor<float>(a[1],b[2])");
std::vector<float> bias_values({4.0, 5.0});
- DenseTensorView bias(bias_type, TypedCells(bias_values));
+ DenseValueView bias(bias_type, TypedCells(bias_values));
EXPECT_TRUE(planner.bind_input_type(bias_type, model.inputs()[2]));
EXPECT_EQ(planner.make_output_type(model.outputs()[0]).to_spec(),
@@ -214,7 +214,7 @@ TEST(OnnxTest, dynamic_onnx_model_can_be_evaluated)
EXPECT_EQ(GetCell::from(cells, 0), 79.0);
//-------------------------------------------------------------------------
std::vector<float> new_bias_values({5.0,6.0});
- DenseTensorView new_bias(bias_type, TypedCells(new_bias_values));
+ DenseValueView new_bias(bias_type, TypedCells(new_bias_values));
ctx.bind_param(2, new_bias);
ctx.eval();
EXPECT_EQ(GetCell::from(output.cells(), 0), 81.0);
@@ -228,17 +228,17 @@ TEST(OnnxTest, int_types_onnx_model_can_be_evaluated)
ValueType query_type = ValueType::from_spec("tensor<float>(a[1],b[4])");
std::vector<float> query_values({1.0, 2.0, 3.0, 4.0});
- DenseTensorView query(query_type, TypedCells(query_values));
+ DenseValueView query(query_type, TypedCells(query_values));
EXPECT_TRUE(planner.bind_input_type(query_type, model.inputs()[0]));
ValueType attribute_type = ValueType::from_spec("tensor<double>(a[4],b[1])");
std::vector<double> attribute_values({5.0, 6.0, 7.0, 8.0});
- DenseTensorView attribute(attribute_type, TypedCells(attribute_values));
+ DenseValueView attribute(attribute_type, TypedCells(attribute_values));
EXPECT_TRUE(planner.bind_input_type(attribute_type, model.inputs()[1]));
ValueType bias_type = ValueType::from_spec("tensor<double>(a[1],b[1])");
std::vector<double> bias_values({9.0});
- DenseTensorView bias(bias_type, TypedCells(bias_values));
+ DenseValueView bias(bias_type, TypedCells(bias_values));
EXPECT_TRUE(planner.bind_input_type(bias_type, model.inputs()[2]));
EXPECT_EQ(planner.make_output_type(model.outputs()[0]),
@@ -260,7 +260,7 @@ TEST(OnnxTest, int_types_onnx_model_can_be_evaluated)
EXPECT_EQ(GetCell::from(cells, 0), 79.0);
//-------------------------------------------------------------------------
std::vector<double> new_bias_values({10.0});
- DenseTensorView new_bias(bias_type, TypedCells(new_bias_values));
+ DenseValueView new_bias(bias_type, TypedCells(new_bias_values));
ctx.bind_param(2, new_bias);
ctx.eval();
EXPECT_EQ(GetCell::from(output.cells(), 0), 80.0);
@@ -274,13 +274,13 @@ TEST(OnnxTest, we_guess_batch_dimension_size_when_inference_fails) {
ValueType in_3_type = ValueType::from_spec("tensor<float>(a[3])");
std::vector<float> in_3_values({1.0, 2.0, 3.0});
- DenseTensorView in_3(in_3_type, TypedCells(in_3_values));
+ DenseValueView in_3(in_3_type, TypedCells(in_3_values));
EXPECT_TRUE(planner_3.bind_input_type(in_3_type, model.inputs()[0]));
EXPECT_TRUE(planner_3.bind_input_type(in_3_type, model.inputs()[1]));
ValueType in_4_type = ValueType::from_spec("tensor<float>(a[4])");
std::vector<float> in_4_values({1.0, 2.0, 3.0, 4.0});
- DenseTensorView in_4(in_4_type, TypedCells(in_4_values));
+ DenseValueView in_4(in_4_type, TypedCells(in_4_values));
EXPECT_TRUE(planner_4.bind_input_type(in_4_type, model.inputs()[0]));
EXPECT_TRUE(planner_4.bind_input_type(in_4_type, model.inputs()[1]));
diff --git a/eval/src/vespa/eval/instruction/dense_lambda_peek_function.cpp b/eval/src/vespa/eval/instruction/dense_lambda_peek_function.cpp
index c590feb3d4c..bf9d5b10a5f 100644
--- a/eval/src/vespa/eval/instruction/dense_lambda_peek_function.cpp
+++ b/eval/src/vespa/eval/instruction/dense_lambda_peek_function.cpp
@@ -32,7 +32,7 @@ void my_lambda_peek_op(InterpretedFunction::State &state, uint64_t param) {
for (uint32_t idx: lookup_table) {
*dst++ = src_cells[idx];
}
- state.pop_push(state.stash.create<tensor::DenseTensorView>(self.result_type, TypedCells(dst_cells)));
+ state.pop_push(state.stash.create<DenseValueView>(self.result_type, TypedCells(dst_cells)));
}
struct MyLambdaPeekOp {
diff --git a/eval/src/vespa/eval/instruction/dense_matmul_function.cpp b/eval/src/vespa/eval/instruction/dense_matmul_function.cpp
index 66b4fe05cde..1394a201e6d 100644
--- a/eval/src/vespa/eval/instruction/dense_matmul_function.cpp
+++ b/eval/src/vespa/eval/instruction/dense_matmul_function.cpp
@@ -43,7 +43,7 @@ void my_matmul_op(InterpretedFunction::State &state, uint64_t param) {
}
lhs += (lhs_common_inner ? self.common_size : 1);
}
- state.pop_pop_push(state.stash.create<tensor::DenseTensorView>(self.result_type, TypedCells(dst_cells)));
+ state.pop_pop_push(state.stash.create<DenseValueView>(self.result_type, TypedCells(dst_cells)));
}
template <bool lhs_common_inner, bool rhs_common_inner>
@@ -57,7 +57,7 @@ void my_cblas_double_matmul_op(InterpretedFunction::State &state, uint64_t param
lhs_cells.cbegin(), lhs_common_inner ? self.common_size : self.lhs_size,
rhs_cells.cbegin(), rhs_common_inner ? self.common_size : self.rhs_size,
0.0, dst_cells.begin(), self.rhs_size);
- state.pop_pop_push(state.stash.create<tensor::DenseTensorView>(self.result_type, TypedCells(dst_cells)));
+ state.pop_pop_push(state.stash.create<DenseValueView>(self.result_type, TypedCells(dst_cells)));
}
template <bool lhs_common_inner, bool rhs_common_inner>
@@ -71,7 +71,7 @@ void my_cblas_float_matmul_op(InterpretedFunction::State &state, uint64_t param)
lhs_cells.cbegin(), lhs_common_inner ? self.common_size : self.lhs_size,
rhs_cells.cbegin(), rhs_common_inner ? self.common_size : self.rhs_size,
0.0, dst_cells.begin(), self.rhs_size);
- state.pop_pop_push(state.stash.create<tensor::DenseTensorView>(self.result_type, TypedCells(dst_cells)));
+ state.pop_pop_push(state.stash.create<DenseValueView>(self.result_type, TypedCells(dst_cells)));
}
bool is_matrix(const ValueType &type) {
diff --git a/eval/src/vespa/eval/instruction/dense_multi_matmul_function.cpp b/eval/src/vespa/eval/instruction/dense_multi_matmul_function.cpp
index a5ece2e84cd..6d05c8a8d1e 100644
--- a/eval/src/vespa/eval/instruction/dense_multi_matmul_function.cpp
+++ b/eval/src/vespa/eval/instruction/dense_multi_matmul_function.cpp
@@ -1,7 +1,6 @@
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "dense_multi_matmul_function.h"
-#include <vespa/eval/tensor/dense/dense_tensor_view.h>
#include <vespa/vespalib/objects/objectvisitor.h>
#include <vespa/eval/eval/value.h>
#include <vespa/eval/eval/operation.h>
@@ -36,7 +35,7 @@ void my_cblas_double_multi_matmul_op(InterpretedFunction::State &state, uint64_t
rhs, self.rhs_common_inner() ? self.common_size() : self.rhs_size(),
0.0, dst, self.rhs_size());
}
- state.pop_pop_push(state.stash.create<tensor::DenseTensorView>(self.result_type(), TypedCells(dst_cells)));
+ state.pop_pop_push(state.stash.create<DenseValueView>(self.result_type(), TypedCells(dst_cells)));
}
void my_cblas_float_multi_matmul_op(InterpretedFunction::State &state, uint64_t param) {
@@ -57,7 +56,7 @@ void my_cblas_float_multi_matmul_op(InterpretedFunction::State &state, uint64_t
rhs, self.rhs_common_inner() ? self.common_size() : self.rhs_size(),
0.0, dst, self.rhs_size());
}
- state.pop_pop_push(state.stash.create<tensor::DenseTensorView>(self.result_type(), TypedCells(dst_cells)));
+ state.pop_pop_push(state.stash.create<DenseValueView>(self.result_type(), TypedCells(dst_cells)));
}
InterpretedFunction::op_function my_select(CellType cell_type) {
diff --git a/eval/src/vespa/eval/instruction/dense_simple_expand_function.cpp b/eval/src/vespa/eval/instruction/dense_simple_expand_function.cpp
index 4f2551211db..a656a0249f9 100644
--- a/eval/src/vespa/eval/instruction/dense_simple_expand_function.cpp
+++ b/eval/src/vespa/eval/instruction/dense_simple_expand_function.cpp
@@ -49,7 +49,7 @@ void my_simple_expand_op(State &state, uint64_t param) {
apply_op2_vec_num(dst, inner_cells.begin(), outer_cell, inner_cells.size(), my_op);
dst += inner_cells.size();
}
- state.pop_pop_push(state.stash.create<tensor::DenseTensorView>(params.result_type, TypedCells(dst_cells)));
+ state.pop_pop_push(state.stash.create<DenseValueView>(params.result_type, TypedCells(dst_cells)));
}
//-----------------------------------------------------------------------------
diff --git a/eval/src/vespa/eval/instruction/dense_xw_product_function.cpp b/eval/src/vespa/eval/instruction/dense_xw_product_function.cpp
index 3727e782718..7d124555f55 100644
--- a/eval/src/vespa/eval/instruction/dense_xw_product_function.cpp
+++ b/eval/src/vespa/eval/instruction/dense_xw_product_function.cpp
@@ -1,7 +1,6 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "dense_xw_product_function.h"
-#include <vespa/eval/tensor/dense/dense_tensor_view.h>
#include <vespa/vespalib/objects/objectvisitor.h>
#include <vespa/eval/eval/value.h>
#include <vespa/eval/eval/operation.h>
@@ -40,7 +39,7 @@ void my_xw_product_op(InterpretedFunction::State &state, uint64_t param) {
*dst++ = my_dot_product<LCT,RCT,common_inner>(vector_cells.cbegin(), matrix, self.vector_size, self.result_size);
matrix += (common_inner ? self.vector_size : 1);
}
- state.pop_pop_push(state.stash.create<tensor::DenseTensorView>(self.result_type, TypedCells(dst_cells)));
+ state.pop_pop_push(state.stash.create<DenseValueView>(self.result_type, TypedCells(dst_cells)));
}
template <bool common_inner>
@@ -54,7 +53,7 @@ void my_cblas_double_xw_product_op(InterpretedFunction::State &state, uint64_t p
common_inner ? self.vector_size : self.result_size,
1.0, matrix_cells.cbegin(), common_inner ? self.vector_size : self.result_size, vector_cells.cbegin(), 1,
0.0, dst_cells.begin(), 1);
- state.pop_pop_push(state.stash.create<tensor::DenseTensorView>(self.result_type, TypedCells(dst_cells)));
+ state.pop_pop_push(state.stash.create<DenseValueView>(self.result_type, TypedCells(dst_cells)));
}
template <bool common_inner>
@@ -68,7 +67,7 @@ void my_cblas_float_xw_product_op(InterpretedFunction::State &state, uint64_t pa
common_inner ? self.vector_size : self.result_size,
1.0, matrix_cells.cbegin(), common_inner ? self.vector_size : self.result_size, vector_cells.cbegin(), 1,
0.0, dst_cells.begin(), 1);
- state.pop_pop_push(state.stash.create<tensor::DenseTensorView>(self.result_type, TypedCells(dst_cells)));
+ state.pop_pop_push(state.stash.create<DenseValueView>(self.result_type, TypedCells(dst_cells)));
}
bool isDenseTensor(const ValueType &type, size_t d) {
diff --git a/eval/src/vespa/eval/instruction/generic_concat.cpp b/eval/src/vespa/eval/instruction/generic_concat.cpp
index 2d8c206b588..4d949d5e725 100644
--- a/eval/src/vespa/eval/instruction/generic_concat.cpp
+++ b/eval/src/vespa/eval/instruction/generic_concat.cpp
@@ -103,7 +103,7 @@ void my_dense_simple_concat_op(State &state, uint64_t param_in) {
for (size_t i = 0; i < b.size(); ++i) {
*pos++ = b[i];
}
- Value &ref = state.stash.create<tensor::DenseTensorView>(param.res_type, TypedCells(result));
+ Value &ref = state.stash.create<DenseValueView>(param.res_type, TypedCells(result));
state.pop_pop_push(ref);
}
diff --git a/eval/src/vespa/eval/tensor/dense/dense_replace_type_function.cpp b/eval/src/vespa/eval/tensor/dense/dense_replace_type_function.cpp
index d7bc7dc860d..ed75d6fff98 100644
--- a/eval/src/vespa/eval/tensor/dense/dense_replace_type_function.cpp
+++ b/eval/src/vespa/eval/tensor/dense/dense_replace_type_function.cpp
@@ -1,11 +1,12 @@
// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "dense_replace_type_function.h"
-#include "dense_tensor_view.h"
#include <vespa/eval/eval/value.h>
namespace vespalib::tensor {
+using eval::DenseValueView;
+using eval::TypedCells;
using eval::Value;
using eval::ValueType;
using eval::TensorFunction;
@@ -17,7 +18,7 @@ namespace {
void my_replace_type_op(eval::InterpretedFunction::State &state, uint64_t param) {
const ValueType &type = unwrap_param<ValueType>(param);
TypedCells cells = state.peek(0).cells();
- state.pop_push(state.stash.create<DenseTensorView>(type, cells));
+ state.pop_push(state.stash.create<DenseValueView>(type, cells));
}
} // namespace vespalib::tensor::<unnamed>
diff --git a/eval/src/vespa/eval/tensor/dense/dense_simple_join_function.cpp b/eval/src/vespa/eval/tensor/dense/dense_simple_join_function.cpp
index 8e7bd72a0f6..21b47b67291 100644
--- a/eval/src/vespa/eval/tensor/dense/dense_simple_join_function.cpp
+++ b/eval/src/vespa/eval/tensor/dense/dense_simple_join_function.cpp
@@ -1,7 +1,6 @@
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "dense_simple_join_function.h"
-#include "dense_tensor_view.h"
#include <vespa/vespalib/objects/objectvisitor.h>
#include <vespa/eval/eval/value.h>
#include <vespa/eval/eval/operation.h>
@@ -15,10 +14,12 @@ namespace vespalib::tensor {
using vespalib::ArrayRef;
using eval::CellType;
-using eval::Value;
-using eval::ValueType;
+using eval::DenseValueView;
using eval::TensorFunction;
+using eval::TypedCells;
using eval::TypifyCellType;
+using eval::Value;
+using eval::ValueType;
using eval::as;
using namespace eval::operation;
@@ -91,7 +92,7 @@ void my_simple_join_op(State &state, uint64_t param) {
offset += sec_cells.size();
}
}
- state.pop_pop_push(state.stash.create<DenseTensorView>(params.result_type, TypedCells(dst_cells)));
+ state.pop_pop_push(state.stash.create<DenseValueView>(params.result_type, TypedCells(dst_cells)));
}
//-----------------------------------------------------------------------------
diff --git a/eval/src/vespa/eval/tensor/dense/dense_simple_map_function.cpp b/eval/src/vespa/eval/tensor/dense/dense_simple_map_function.cpp
index b6376326468..5227b67dd92 100644
--- a/eval/src/vespa/eval/tensor/dense/dense_simple_map_function.cpp
+++ b/eval/src/vespa/eval/tensor/dense/dense_simple_map_function.cpp
@@ -1,7 +1,6 @@
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "dense_simple_map_function.h"
-#include "dense_tensor_view.h"
#include <vespa/vespalib/util/typify.h>
#include <vespa/eval/eval/value.h>
#include <vespa/eval/eval/operation.h>
@@ -11,10 +10,12 @@ namespace vespalib::tensor {
using vespalib::ArrayRef;
-using eval::Value;
-using eval::ValueType;
+using eval::DenseValueView;
using eval::TensorFunction;
+using eval::TypedCells;
using eval::TypifyCellType;
+using eval::Value;
+using eval::ValueType;
using eval::as;
using namespace eval::operation;
@@ -43,7 +44,7 @@ void my_simple_map_op(State &state, uint64_t param) {
auto dst_cells = make_dst_cells<CT, inplace>(src_cells, state.stash);
apply_op1_vec(dst_cells.begin(), src_cells.begin(), dst_cells.size(), my_fun);
if (!inplace) {
- state.pop_push(state.stash.create<DenseTensorView>(child.type(), TypedCells(dst_cells)));
+ state.pop_push(state.stash.create<DenseValueView>(child.type(), TypedCells(dst_cells)));
}
}
diff --git a/eval/src/vespa/eval/tensor/dense/dense_single_reduce_function.cpp b/eval/src/vespa/eval/tensor/dense/dense_single_reduce_function.cpp
index 82d4505dc80..f107e85eaa2 100644
--- a/eval/src/vespa/eval/tensor/dense/dense_single_reduce_function.cpp
+++ b/eval/src/vespa/eval/tensor/dense/dense_single_reduce_function.cpp
@@ -9,10 +9,12 @@
namespace vespalib::tensor {
using eval::Aggr;
+using eval::DenseValueView;
using eval::InterpretedFunction;
using eval::TensorFunction;
using eval::Value;
using eval::ValueType;
+using eval::TypedCells;
using eval::TypifyCellType;
using eval::TypifyAggr;
using eval::as;
@@ -124,7 +126,7 @@ void my_single_reduce_op(InterpretedFunction::State &state, uint64_t param) {
} else {
trace_reduce_impl<CT,AGGR,atleast_8,is_inner>(params, src, dst);
}
- state.pop_push(state.stash.create<DenseTensorView>(params.result_type, TypedCells(dst_cells)));
+ state.pop_push(state.stash.create<DenseValueView>(params.result_type, TypedCells(dst_cells)));
}
struct MyGetFun {
diff --git a/eval/src/vespa/eval/tensor/dense/dense_tensor_create_function.cpp b/eval/src/vespa/eval/tensor/dense/dense_tensor_create_function.cpp
index 4cdaa01eea8..e38cf638e9c 100644
--- a/eval/src/vespa/eval/tensor/dense/dense_tensor_create_function.cpp
+++ b/eval/src/vespa/eval/tensor/dense/dense_tensor_create_function.cpp
@@ -7,6 +7,7 @@
namespace vespalib::tensor {
+using eval::DenseValueView;
using eval::Value;
using eval::DoubleValue;
using eval::ValueType;
@@ -27,7 +28,7 @@ void my_tensor_create_op(eval::InterpretedFunction::State &state, uint64_t param
cells[pending_cells] = (CT) state.peek(0).as_double();
state.stack.pop_back();
}
- const Value &result = state.stash.create<DenseTensorView>(self.result_type, TypedCells(cells));
+ const Value &result = state.stash.create<DenseValueView>(self.result_type, TypedCells(cells));
state.stack.emplace_back(result);
}
diff --git a/eval/src/vespa/eval/tensor/dense/onnx_wrapper.cpp b/eval/src/vespa/eval/tensor/dense/onnx_wrapper.cpp
index c49809f265f..0dc8b343627 100644
--- a/eval/src/vespa/eval/tensor/dense/onnx_wrapper.cpp
+++ b/eval/src/vespa/eval/tensor/dense/onnx_wrapper.cpp
@@ -2,7 +2,6 @@
#include "onnx_wrapper.h"
#include <vespa/eval/eval/value_type.h>
-#include "dense_tensor_view.h"
#include "dense_tensor.h"
#include <vespa/vespalib/util/arrayref.h>
#include <vespa/vespalib/util/stringfmt.h>
@@ -20,8 +19,10 @@ LOG_SETUP(".eval.onnx_wrapper");
using vespalib::ArrayRef;
using vespalib::ConstArrayRef;
using vespalib::eval::CellType;
-using vespalib::eval::ValueType;
+using vespalib::eval::DenseValueView;
+using vespalib::eval::TypedCells;
using vespalib::eval::TypifyCellType;
+using vespalib::eval::ValueType;
using vespalib::make_string_short::fmt;
@@ -73,7 +74,7 @@ struct CreateVespaTensorRef {
template <typename T> static eval::Value::UP invoke(const eval::ValueType &type_ref, Ort::Value &value) {
size_t num_cells = type_ref.dense_subspace_size();
ConstArrayRef<T> cells(value.GetTensorMutableData<T>(), num_cells);
- return std::make_unique<DenseTensorView>(type_ref, TypedCells(cells));
+ return std::make_unique<DenseValueView>(type_ref, TypedCells(cells));
}
eval::Value::UP operator()(const eval::ValueType &type_ref, Ort::Value &value) {
return typify_invoke<1,MyTypify,CreateVespaTensorRef>(type_ref.cell_type(), type_ref, value);
diff --git a/eval/src/vespa/eval/tensor/dense/vector_from_doubles_function.cpp b/eval/src/vespa/eval/tensor/dense/vector_from_doubles_function.cpp
index 0d653acee4d..19c95c9418d 100644
--- a/eval/src/vespa/eval/tensor/dense/vector_from_doubles_function.cpp
+++ b/eval/src/vespa/eval/tensor/dense/vector_from_doubles_function.cpp
@@ -1,14 +1,16 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "vector_from_doubles_function.h"
-#include "dense_tensor_view.h"
#include <vespa/eval/eval/value.h>
namespace vespalib::tensor {
+using eval::CellType;
+using eval::DenseValueView;
+using eval::TensorFunction;
+using eval::TypedCells;
using eval::Value;
using eval::ValueType;
-using eval::TensorFunction;
using Child = eval::TensorFunction::Child;
using eval::as;
using namespace eval::tensor_function;
@@ -34,7 +36,7 @@ void my_vector_from_doubles_op(eval::InterpretedFunction::State &state, uint64_t
size_t numCells = self.resultSize;
using MyTypify = eval::TypifyCellType;
TypedCells cells = typify_invoke<1,MyTypify,CallVectorFromDoubles>(ct, state, numCells);
- const Value &result = state.stash.create<DenseTensorView>(self.resultType, cells);
+ const Value &result = state.stash.create<DenseValueView>(self.resultType, cells);
state.stack.emplace_back(result);
}