* @brief Destructor for TensorPool which frees all tensors in the pool. */
| 719 | * @brief Destructor for TensorPool which frees all tensors in the pool. |
| 720 | */ |
| 721 | inline TensorPool::~TensorPool() { |
| 722 | // Need to get keys in a separate iteration, otherwise iterator is getting |
| 723 | // invalidated during erase. |
| 724 | std::vector<WGPUBuffer> keys; |
| 725 | for (auto &pair : data) { |
| 726 | keys.push_back(pair.first); |
| 727 | } |
| 728 | for (auto &key : keys) { |
| 729 | FreeTensor(*this, data[key]); |
| 730 | LOG(kDefLog, kTrace, "Freed tensor"); |
| 731 | } |
| 732 | } |
| 733 | |
| 734 | /** |
| 735 | * @brief Checks a condition and logs an error message if the condition is |
nothing calls this directly
no test coverage detected