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

Method ShouldSkipImage

dali/operators/reader/loader/loader.h:466–479  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

464
465
466 bool ShouldSkipImage(const ImageCache::ImageKey& key) {
467 if (!skip_cached_images_)
468 return false;
469
470 // Fetch image cache factory only the first time that we try to load an image
471 // we don't do it in construction because we are not sure that the cache was
472 // created since the order of operator creation is not guaranteed.
473 dali::call_once(fetch_cache_, [this](){
474 auto &image_cache_factory = ImageCacheFactory::Instance();
475 if (image_cache_factory.IsInitialized(device_id_))
476 cache_ = image_cache_factory.Get(device_id_);
477 });
478 return cache_ && cache_->IsCached(key);
479 }
480
481 // Restores state from snapshot, ignoring its age.
482 void RestoreEpochState(const LoaderStateSnapshot &state) {

Callers

nothing calls this directly

Calls 4

call_onceFunction · 0.85
IsInitializedMethod · 0.80
GetMethod · 0.45
IsCachedMethod · 0.45

Tested by

no test coverage detected