From 372fad5bf2bb73f890c5a8285b97347680b705f2 Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Tue, 4 May 2021 10:37:56 +0100 Subject: [PATCH] remove default cache_dir None Signed-off-by: Wenqi Li --- monai/data/dataset.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/monai/data/dataset.py b/monai/data/dataset.py index b8ecd2b35a..b98fce8e58 100644 --- a/monai/data/dataset.py +++ b/monai/data/dataset.py @@ -137,7 +137,7 @@ def __init__( self, data: Sequence, transform: Union[Sequence[Callable], Callable], - cache_dir: Optional[Union[Path, str]] = None, + cache_dir: Optional[Union[Path, str]], hash_func: Callable[..., bytes] = pickle_hashing, ) -> None: """ @@ -150,7 +150,8 @@ def __init__( of pre-computed transformed data tensors. The cache_dir is computed once, and persists on disk until explicitly removed. Different runs, programs, experiments may share a common cache dir provided that the transforms pre-processing is consistent. - If the cache_dir doesn't exist, will automatically create it. + If `cache_dir` doesn't exist, will automatically create it. + If `cache_dir` is `None`, there is effectively no caching. hash_func: a callable to compute hash from data items to be cached. defaults to `monai.data.utils.pickle_hashing`. @@ -271,7 +272,7 @@ def __init__( data: Sequence, transform: Union[Sequence[Callable], Callable], cache_n_trans: int, - cache_dir: Optional[Union[Path, str]] = None, + cache_dir: Optional[Union[Path, str]], hash_func: Callable[..., bytes] = pickle_hashing, ) -> None: """ @@ -285,7 +286,8 @@ def __init__( of pre-computed transformed data tensors. The cache_dir is computed once, and persists on disk until explicitly removed. Different runs, programs, experiments may share a common cache dir provided that the transforms pre-processing is consistent. - If the cache_dir doesn't exist, will automatically create it. + If `cache_dir` doesn't exist, will automatically create it. + If `cache_dir` is `None`, there is effectively no caching. hash_func: a callable to compute hash from data items to be cached. defaults to `monai.data.utils.pickle_hashing`.