| 491 | // Copy values starting from index `start` into `out_data` |
| 492 | template <typename Value> |
| 493 | void CopyValues(int32_t start, Value* out_data) const { |
| 494 | // So that both uint16_t and Float16 are allowed |
| 495 | static_assert(sizeof(Value) == sizeof(Scalar)); |
| 496 | Scalar* out = reinterpret_cast<Scalar*>(out_data); |
| 497 | hash_table_.VisitEntries([=](const HashTableEntry* entry) { |
| 498 | int32_t index = entry->payload.memo_index - start; |
| 499 | if (index >= 0) { |
| 500 | out[index] = entry->payload.value; |
| 501 | } |
| 502 | }); |
| 503 | // Zero-initialize the null entry |
| 504 | if (null_index_ != kKeyNotFound) { |
| 505 | int32_t index = null_index_ - start; |
| 506 | if (index >= 0) { |
| 507 | out[index] = Scalar{}; |
| 508 | } |
| 509 | } |
| 510 | } |
| 511 | |
| 512 | template <typename Value> |
| 513 | void CopyValues(Value* out_data) const { |