Skip to content

Commit 1a10fda

Browse files
authored
Fix save_dir in the tune function (#190)
1 parent 66bfbc0 commit 1a10fda

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

torchsparse/utils/tune.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def tune(
8181
collect_fn: Callable = lambda data: data,
8282
enable_fp16: bool = False,
8383
kmap_mode: str = 'hashmap',
84-
save_dir: str = '~/.torchsparse',
84+
save_dir: str = None,
8585
tune_id: str = 'temp',
8686
):
8787
"""Search for the best group strategy by the provided model and data loader.
@@ -139,6 +139,8 @@ def dump(module, inputs, outputs, name):
139139
})
140140

141141
group_configs = {}
142+
if save_dir is None:
143+
save_dir = os.path.expanduser('~/.torchsparse')
142144
if os.path.exists(os.path.join(save_dir, tune_id)):
143145
print('Load existing tuned group configs')
144146
group_configs = torch.load(os.path.join(save_dir, tune_id))

0 commit comments

Comments
 (0)