@@ -129,10 +129,6 @@ class EngineABCRunParams(TypedDict, total=False):
129129 Optional Keys:
130130 batch_size (int):
131131 Number of image patches per forward pass.
132- cache_mode (bool):
133- Whether to use caching for large datasets.
134- cache_size (int):
135- Number of patches to process in a batch when caching.
136132 class_dict (dict):
137133 Mapping of classification outputs to class names.
138134 device (str):
@@ -173,8 +169,6 @@ class EngineABCRunParams(TypedDict, total=False):
173169 """
174170
175171 batch_size : int
176- cache_mode : bool
177- cache_size : int
178172 class_dict : dict
179173 device : str
180174 ioconfig : ModelIOConfigABC
@@ -277,10 +271,6 @@ class EngineABC(ABC): # noqa: B024
277271 `stride_shape=patch_input_shape`.
278272 batch_size (int):
279273 Number of images fed into the model each time.
280- cache_mode (bool):
281- Whether to use caching for large datasets.
282- cache_size (int):
283- Number of patches to process in a batch when caching.
284274 labels (list | None):
285275 Optional labels for input images.
286276 Only a single label per image is supported.
@@ -370,8 +360,6 @@ def __init__(
370360 )
371361 self ._ioconfig = self .ioconfig # runtime ioconfig
372362 self .batch_size = batch_size
373- self .cache_mode : bool = False
374- self .cache_size : int = self .batch_size if self .batch_size else 10000
375363 self .labels : list | None = None
376364 self .num_loader_workers = num_loader_workers
377365 self .num_post_proc_workers = num_post_proc_workers
@@ -1065,22 +1053,13 @@ def _update_run_params(
10651053 self .drop_keys .append ("label" )
10661054
10671055 self .patch_mode = patch_mode
1068- if not self .patch_mode :
1069- self .cache_mode = True # if input is WSI run using cache mode.
1070-
1071- if self .cache_mode and self .batch_size > self .cache_size :
1072- self .batch_size = self .cache_size
10731056
10741057 self ._validate_input_numbers (images = images , masks = masks , labels = labels )
10751058 if output_type .lower () not in ["dict" , "zarr" , "annotationstore" ]:
10761059 msg = "output_type must be 'dict' or 'zarr' or 'annotationstore'."
10771060 raise TypeError (msg )
10781061
10791062 self .output_type = output_type
1080- if self .cache_mode and output_type .lower () not in ["zarr" , "annotationstore" ]:
1081- self .output_type = "zarr"
1082- msg = "output_type has been updated to 'zarr' for cache_mode=True."
1083- logger .info (msg )
10841063
10851064 if save_dir is not None and output_type .lower () not in [
10861065 "zarr" ,
@@ -1149,7 +1128,7 @@ def _run_patch_mode(
11491128
11501129 """
11511130 save_path = None
1152- if self . cache_mode or save_dir :
1131+ if save_dir :
11531132 output_file = Path (kwargs .get ("output_file" , "output.zarr" ))
11541133 save_path = save_dir / (str (output_file .stem ) + ".zarr" )
11551134
0 commit comments