@@ -49,7 +49,7 @@ class MNIST(Dataset):
49
49
cache_folder_name = 'complete'
50
50
51
51
def __init__ (self , root : str = PATH_DATASETS , train : bool = True ,
52
- normalize : tuple = (0.5 , 1.0 ), download : bool = False ):
52
+ normalize : tuple = (0.5 , 1.0 ), download : bool = True ):
53
53
super ().__init__ ()
54
54
self .root = root
55
55
self .train = train # training set or test set
@@ -86,8 +86,7 @@ def _check_exists(self, data_folder: str) -> bool:
86
86
return existing
87
87
88
88
def prepare_data (self , download : bool ):
89
- if download :
90
- self ._download (self .cached_folder_path )
89
+ self ._download (self .cached_folder_path )
91
90
92
91
def _download (self , data_folder : str ) -> None :
93
92
"""Download the MNIST data if it doesn't exist in cached_folder_path already."""
@@ -175,8 +174,7 @@ def _prepare_subset(full_data: torch.Tensor, full_targets: torch.Tensor,
175
174
def prepare_data (self , download : bool ) -> None :
176
175
if self ._check_exists (self .cached_folder_path ):
177
176
return
178
- if download :
179
- self ._download (super ().cached_folder_path )
177
+ self ._download (super ().cached_folder_path )
180
178
181
179
for fname in (self .TRAIN_FILE_NAME , self .TEST_FILE_NAME ):
182
180
data , targets = torch .load (os .path .join (super ().cached_folder_path , fname ))
0 commit comments