| 196 | } |
| 197 | |
| 198 | Maybe<TensorRTEngineCache::Engine> TensorRTEngineCacheIO::get(const std::string& key) { |
| 199 | MGB_LOCK_GUARD(m_mtx); |
| 200 | auto find = m_cache.find(key); |
| 201 | if (find == m_cache.end()) |
| 202 | return None; |
| 203 | return find->second; |
| 204 | } |
| 205 | |
| 206 | void TensorRTEngineCacheIO::put(const std::string& key, const Engine& value) { |
| 207 | MGB_LOCK_GUARD(m_mtx); |