diff options
Diffstat (limited to 'eval')
-rw-r--r-- | eval/src/vespa/eval/tensor/sparse/sparse_tensor.cpp | 4 |
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); |