MCPcopy Create free account
hub / github.com/NVIDIA/DALI / GetFromCache

Method GetFromCache

dali/operators/reader/loader/numpy_loader.cc:29–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27namespace detail {
28
29bool NumpyHeaderCache::GetFromCache(const string &file_name, numpy::HeaderData &header) {
30 if (!cache_headers_) {
31 return false;
32 }
33 std::unique_lock<std::mutex> cache_lock(cache_mutex_);
34 auto it = header_cache_.find(file_name);
35 if (it == header_cache_.end()) {
36 return false;
37 } else {
38 header = it->second;
39 return true;
40 }
41}
42
43void NumpyHeaderCache::UpdateCache(const string &file_name, const numpy::HeaderData &value) {
44 if (cache_headers_) {

Callers 2

ReadSampleMethod · 0.80
ReadHeaderMethod · 0.80

Calls 2

findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected