summaryrefslogtreecommitdiffstats
path: root/eval
diff options
context:
space:
mode:
authorGeir Storli <geirst@verizonmedia.com>2020-11-20 14:52:37 +0000
committerGeir Storli <geirst@verizonmedia.com>2020-11-20 14:52:37 +0000
commit52d3433fad15af878b11899a198116b350747d77 (patch)
tree00da37b4d3ce4933f97ef14a8f503a53cd504297 /eval
parentc9bba1111ab5069e779f09d79c43d3ba2fc4be1e (diff)
Add partial update remove test with mixed tensor as input.
Diffstat (limited to 'eval')
-rw-r--r--eval/src/tests/tensor/partial_remove/partial_remove_test.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/eval/src/tests/tensor/partial_remove/partial_remove_test.cpp b/eval/src/tests/tensor/partial_remove/partial_remove_test.cpp
index e182fffa890..5af2396f5ec 100644
--- a/eval/src/tests/tensor/partial_remove/partial_remove_test.cpp
+++ b/eval/src/tests/tensor/partial_remove/partial_remove_test.cpp
@@ -124,20 +124,31 @@ expect_partial_remove(const TensorSpec& input, const TensorSpec& remove, const T
}
TEST(PartialRemoveTest, remove_where_address_is_not_fully_specified) {
- auto input = TensorSpec("tensor(x{},y{})").
+ auto input_sparse = TensorSpec("tensor(x{},y{})").
add({{"x", "a"},{"y", "c"}}, 3.0).
add({{"x", "a"},{"y", "d"}}, 5.0).
add({{"x", "b"},{"y", "c"}}, 7.0);
- expect_partial_remove(input,TensorSpec("tensor(x{})").add({{"x", "a"}}, 1.0),
+ expect_partial_remove(input_sparse, TensorSpec("tensor(x{})").add({{"x", "a"}}, 1.0),
TensorSpec("tensor(x{},y{})").add({{"x", "b"},{"y", "c"}}, 7.0));
- expect_partial_remove(input, TensorSpec("tensor(y{})").add({{"y", "c"}}, 1.0),
+ expect_partial_remove(input_sparse, TensorSpec("tensor(y{})").add({{"y", "c"}}, 1.0),
TensorSpec("tensor(x{},y{})").add({{"x", "a"},{"y", "d"}}, 5.0));
- expect_partial_remove(input, TensorSpec("tensor(y{})").add({{"y", "d"}}, 1.0),
+ expect_partial_remove(input_sparse, TensorSpec("tensor(y{})").add({{"y", "d"}}, 1.0),
TensorSpec("tensor(x{},y{})").add({{"x", "a"},{"y", "c"}}, 3.0)
.add({{"x", "b"},{"y", "c"}}, 7.0));
+
+ auto input_mixed = TensorSpec("tensor(x{},y{},z[1])").
+ add({{"x", "a"},{"y", "c"},{"z", 0}}, 3.0).
+ add({{"x", "a"},{"y", "d"},{"z", 0}}, 5.0).
+ add({{"x", "b"},{"y", "c"},{"z", 0}}, 7.0);
+
+ expect_partial_remove(input_mixed,TensorSpec("tensor(x{})").add({{"x", "a"}}, 1.0),
+ TensorSpec("tensor(x{},y{},z[1])").add({{"x", "b"},{"y", "c"},{"z", 0}}, 7.0));
+
+ expect_partial_remove(input_mixed, TensorSpec("tensor(y{})").add({{"y", "c"}}, 1.0),
+ TensorSpec("tensor(x{},y{},z[1])").add({{"x", "a"},{"y", "d"},{"z", 0}}, 5.0));
}
GTEST_MAIN_RUN_ALL_TESTS()