summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2020-12-08 11:53:50 +0000
committerArne Juul <arnej@verizonmedia.com>2020-12-08 12:30:53 +0000
commit73b6d97d322cad6e9da7dfe0808ee91ef3a0ea7e (patch)
tree42c0e8ecdcf5728c4cc562a4f36957bf29471233
parent86296162549ea0dc5120fabd2461d46a8cb3a7fd (diff)
remove tensor.h and tensorengine.h
-rw-r--r--eval/src/tests/eval/value_cache/tensor_loader_test.cpp1
-rw-r--r--eval/src/vespa/eval/eval/CMakeLists.txt2
-rw-r--r--eval/src/vespa/eval/eval/tensor.cpp26
-rw-r--r--eval/src/vespa/eval/eval/tensor.h38
-rw-r--r--eval/src/vespa/eval/eval/tensor_engine.cpp9
-rw-r--r--eval/src/vespa/eval/eval/tensor_engine.h62
-rw-r--r--eval/src/vespa/eval/eval/tensor_function.cpp1
-rw-r--r--eval/src/vespa/eval/eval/tensor_spec.cpp2
-rw-r--r--eval/src/vespa/eval/eval/test/value_compare.cpp2
-rw-r--r--eval/src/vespa/eval/eval/value.h3
-rw-r--r--eval/src/vespa/eval/eval/value_cache/constant_tensor_loader.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/match_master.cpp1
12 files changed, 0 insertions, 148 deletions
diff --git a/eval/src/tests/eval/value_cache/tensor_loader_test.cpp b/eval/src/tests/eval/value_cache/tensor_loader_test.cpp
index 648a6c25c28..3ec57e0eecb 100644
--- a/eval/src/tests/eval/value_cache/tensor_loader_test.cpp
+++ b/eval/src/tests/eval/value_cache/tensor_loader_test.cpp
@@ -4,7 +4,6 @@
#include <vespa/eval/eval/simple_value.h>
#include <vespa/eval/eval/value_codec.h>
#include <vespa/eval/eval/tensor_spec.h>
-#include <vespa/eval/eval/tensor.h>
using namespace vespalib::eval;
diff --git a/eval/src/vespa/eval/eval/CMakeLists.txt b/eval/src/vespa/eval/eval/CMakeLists.txt
index 57c0db1719b..01eeff49662 100644
--- a/eval/src/vespa/eval/eval/CMakeLists.txt
+++ b/eval/src/vespa/eval/eval/CMakeLists.txt
@@ -27,8 +27,6 @@ vespa_add_library(eval_eval OBJECT
param_usage.cpp
simple_value.cpp
string_stuff.cpp
- tensor.cpp
- tensor_engine.cpp
tensor_function.cpp
tensor_nodes.cpp
tensor_spec.cpp
diff --git a/eval/src/vespa/eval/eval/tensor.cpp b/eval/src/vespa/eval/eval/tensor.cpp
deleted file mode 100644
index 9de812b46f0..00000000000
--- a/eval/src/vespa/eval/eval/tensor.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-#include "tensor.h"
-#include "tensor_engine.h"
-#include "tensor_spec.h"
-
-namespace vespalib {
-namespace eval {
-
-bool
-operator==(const Tensor &lhs, const Tensor &rhs)
-{
- auto lhs_spec = TensorSpec::from_value(lhs);
- auto rhs_spec = TensorSpec::from_value(rhs);
- return (lhs_spec == rhs_spec);
-}
-
-std::ostream &
-operator<<(std::ostream &out, const Tensor &tensor)
-{
- out << TensorSpec::from_value(tensor).to_string();
- return out;
-}
-
-} // namespace vespalib::eval
-} // namespace vespalib
diff --git a/eval/src/vespa/eval/eval/tensor.h b/eval/src/vespa/eval/eval/tensor.h
deleted file mode 100644
index a7cb1f2c516..00000000000
--- a/eval/src/vespa/eval/eval/tensor.h
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-#pragma once
-
-#include "value_type.h"
-#include "value.h"
-
-namespace vespalib {
-namespace eval {
-
-/**
- * Base class for all tensors. Tensor operations are defined by the
- * TensorEngine interface. The Tensor class itself is used as a tagged
- * transport mechanism. Each Tensor is connected to a distinct engine
- * which can be used to operate on it. When operating on multiple
- * tensors at the same time they all need to be connected to the same
- * engine. TensorEngines should only have a single static instance per
- * implementation.
- **/
-class Tensor : public Value
-{
-protected:
- Tensor() {}
-public:
- Tensor(const Tensor &) = delete;
- Tensor(Tensor &&) = delete;
- Tensor &operator=(const Tensor &) = delete;
- Tensor &operator=(Tensor &&) = delete;
- bool is_tensor() const override { return true; }
- const Tensor *as_tensor() const override { return this; }
- virtual ~Tensor() {}
-};
-
-bool operator==(const Tensor &lhs, const Tensor &rhs);
-std::ostream &operator<<(std::ostream &out, const Tensor &tensor);
-
-} // namespace vespalib::eval
-} // namespace vespalib
diff --git a/eval/src/vespa/eval/eval/tensor_engine.cpp b/eval/src/vespa/eval/eval/tensor_engine.cpp
deleted file mode 100644
index 9e7948920df..00000000000
--- a/eval/src/vespa/eval/eval/tensor_engine.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-#include "tensor_engine.h"
-
-namespace vespalib {
-namespace eval {
-
-} // namespace vespalib::eval
-} // namespace vespalib
diff --git a/eval/src/vespa/eval/eval/tensor_engine.h b/eval/src/vespa/eval/eval/tensor_engine.h
deleted file mode 100644
index c0625c3e9b8..00000000000
--- a/eval/src/vespa/eval/eval/tensor_engine.h
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-#pragma once
-
-#include "aggr.h"
-#include "operation.h"
-#include <vespa/vespalib/stllike/string.h>
-#include <memory>
-#include <vector>
-#include <functional>
-
-namespace vespalib {
-
-class Stash;
-class nbostream;
-
-namespace eval {
-
-struct Value;
-class ValueType;
-class TensorSpec;
-struct TensorFunction;
-
-/**
- * Top-level API for a tensor implementation. All Tensor operations
- * are defined by the TensorEngine interface. The Tensor class itself
- * is used as a tagged transport mechanism. Each Tensor is connected
- * to a distinct engine which can be used to operate on it. When
- * operating on multiple tensors at the same time they all need to be
- * connected to the same engine. TensorEngines should only have a
- * single static instance per implementation.
- **/
-struct TensorEngine
-{
- using Aggr = eval::Aggr;
- using TensorFunction = eval::TensorFunction;
- using TensorSpec = eval::TensorSpec;
- using Value = eval::Value;
- using ValueType = eval::ValueType;
- using map_fun_t = vespalib::eval::operation::op1_t;
- using join_fun_t = vespalib::eval::operation::op2_t;
-
- virtual TensorSpec to_spec(const Value &value) const = 0;
- virtual std::unique_ptr<Value> from_spec(const TensorSpec &spec) const = 0;
-
- virtual void encode(const Value &value, nbostream &output) const = 0;
- virtual std::unique_ptr<Value> decode(nbostream &input) const = 0;
-
- virtual const TensorFunction &optimize(const TensorFunction &expr, Stash &) const { return expr; }
-
- virtual const Value &map(const Value &a, map_fun_t function, Stash &stash) const = 0;
- virtual const Value &join(const Value &a, const Value &b, join_fun_t function, Stash &stash) const = 0;
- virtual const Value &merge(const Value &a, const Value &b, join_fun_t function, Stash &stash) const = 0;
- virtual const Value &reduce(const Value &a, Aggr aggr, const std::vector<vespalib::string> &dimensions, Stash &stash) const = 0;
- virtual const Value &concat(const Value &a, const Value &b, const vespalib::string &dimension, Stash &stash) const = 0;
- virtual const Value &rename(const Value &a, const std::vector<vespalib::string> &from, const std::vector<vespalib::string> &to, Stash &stash) const = 0;
-
- virtual ~TensorEngine() {}
-};
-
-} // namespace vespalib::eval
-} // namespace vespalib
diff --git a/eval/src/vespa/eval/eval/tensor_function.cpp b/eval/src/vespa/eval/eval/tensor_function.cpp
index fc83889a853..4ea7348f61e 100644
--- a/eval/src/vespa/eval/eval/tensor_function.cpp
+++ b/eval/src/vespa/eval/eval/tensor_function.cpp
@@ -3,7 +3,6 @@
#include "tensor_function.h"
#include "value.h"
#include "operation.h"
-#include "tensor.h"
#include "visit_stuff.h"
#include "string_stuff.h"
#include <vespa/eval/instruction/generic_concat.h>
diff --git a/eval/src/vespa/eval/eval/tensor_spec.cpp b/eval/src/vespa/eval/eval/tensor_spec.cpp
index e082d3bc2ba..2ffbbb7ac66 100644
--- a/eval/src/vespa/eval/eval/tensor_spec.cpp
+++ b/eval/src/vespa/eval/eval/tensor_spec.cpp
@@ -4,8 +4,6 @@
#include "array_array_map.h"
#include "function.h"
#include "interpreted_function.h"
-#include "tensor.h"
-#include "tensor_engine.h"
#include "value.h"
#include "value_codec.h"
#include "value_type.h"
diff --git a/eval/src/vespa/eval/eval/test/value_compare.cpp b/eval/src/vespa/eval/eval/test/value_compare.cpp
index ff6a4e72ebc..cb6eeca4b86 100644
--- a/eval/src/vespa/eval/eval/test/value_compare.cpp
+++ b/eval/src/vespa/eval/eval/test/value_compare.cpp
@@ -1,8 +1,6 @@
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "value_compare.h"
-#include <vespa/eval/eval/tensor.h>
-#include <vespa/eval/eval/tensor_engine.h>
#include <vespa/eval/eval/value_codec.h>
namespace vespalib::eval {
diff --git a/eval/src/vespa/eval/eval/value.h b/eval/src/vespa/eval/eval/value.h
index cf4e21029fc..186c3698dcd 100644
--- a/eval/src/vespa/eval/eval/value.h
+++ b/eval/src/vespa/eval/eval/value.h
@@ -12,8 +12,6 @@
namespace vespalib::eval {
-class Tensor;
-
/**
* An abstract Value.
**/
@@ -69,7 +67,6 @@ struct Value {
virtual bool is_tensor() const { return type().is_tensor(); }
virtual double as_double() const;
bool as_bool() const { return (as_double() != 0.0); }
- virtual const Tensor *as_tensor() const { return nullptr; }
// --- end of old interface
};
diff --git a/eval/src/vespa/eval/eval/value_cache/constant_tensor_loader.cpp b/eval/src/vespa/eval/eval/value_cache/constant_tensor_loader.cpp
index b14892d4c1c..07692474234 100644
--- a/eval/src/vespa/eval/eval/value_cache/constant_tensor_loader.cpp
+++ b/eval/src/vespa/eval/eval/value_cache/constant_tensor_loader.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 "constant_tensor_loader.h"
-#include <vespa/eval/eval/tensor.h>
#include <vespa/eval/eval/tensor_spec.h>
#include <vespa/eval/eval/value_codec.h>
#include <vespa/vespalib/objects/nbostream.h>
diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp b/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp
index 6c86f6c2d1c..6e56d6365ec 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp
@@ -10,7 +10,6 @@
#include <vespa/vespalib/data/slime/inserter.h>
#include <vespa/vespalib/data/slime/inject.h>
#include <vespa/vespalib/data/slime/cursor.h>
-#include <vespa/eval/eval/tensor_engine.h>
#include <vespa/vespalib/objects/nbostream.h>
#include <vespa/log/log.h>