summaryrefslogtreecommitdiffstats
path: root/eval
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2020-09-07 06:48:52 +0000
committerArne Juul <arnej@verizonmedia.com>2020-09-07 06:48:52 +0000
commitcb68428feab8bb84d4c5fe5ef6800c3543ee67f4 (patch)
treec5e649fa4c03e0ba6eabe7189f59f657698c6d94 /eval
parent5648f551b6f8953a79fe4d31ce5ffeebe17609a8 (diff)
add comment explaining dirty tricks
Diffstat (limited to 'eval')
-rw-r--r--eval/src/vespa/eval/tensor/sparse/sparse_tensor.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/eval/src/vespa/eval/tensor/sparse/sparse_tensor.cpp b/eval/src/vespa/eval/tensor/sparse/sparse_tensor.cpp
index b097486c51b..b2bd9330160 100644
--- a/eval/src/vespa/eval/tensor/sparse/sparse_tensor.cpp
+++ b/eval/src/vespa/eval/tensor/sparse/sparse_tensor.cpp
@@ -29,7 +29,11 @@ using Cells = SparseTensor::Cells;
void
copyCells(Cells &cells, const Cells &cells_in, Stash &stash)
{
+ // copy the exact hashtable structure:
cells = cells_in;
+ // copy the actual contents of the addresses,
+ // and update the pointers inside the hashtable
+ // keys so they point to our copy:
for (auto &cell : cells) {
SparseTensorAddressRef oldRef = cell.first;
SparseTensorAddressRef newRef(oldRef, stash);