Safemotion Lib
Loading...
Searching...
No Matches
Classes | Functions
fastreid.utils.file_io Namespace Reference

Classes

class  NativePathHandler
 
class  PathHandler
 
class  PathManager
 

Functions

str get_cache_dir (Optional[str] cache_dir=None)
 

Function Documentation

◆ get_cache_dir()

str fastreid.utils.file_io.get_cache_dir ( Optional[str] cache_dir = None)
Returns a default directory to cache static files
(usually downloaded from Internet), if None is provided.
Args:
    cache_dir (None or str): if not None, will be returned as is.
        If None, returns the default cache directory as:
    1) $FVCORE_CACHE, if set
    2) otherwise ~/.torch/fvcore_cache

Definition at line 23 of file file_io.py.

23def get_cache_dir(cache_dir: Optional[str] = None) -> str:
24 """
25 Returns a default directory to cache static files
26 (usually downloaded from Internet), if None is provided.
27 Args:
28 cache_dir (None or str): if not None, will be returned as is.
29 If None, returns the default cache directory as:
30 1) $FVCORE_CACHE, if set
31 2) otherwise ~/.torch/fvcore_cache
32 """
33 if cache_dir is None:
34 cache_dir = os.path.expanduser(
35 os.getenv("FVCORE_CACHE", "~/.torch/fvcore_cache")
36 )
37 return cache_dir
38
39