Skip to content

Commit

Permalink
Add empty close method as default for Dataset
Browse files Browse the repository at this point in the history
Datasets implemented in the future might want to do some cleanup when
they are destroyed (one example is OldH5Dataset, which closes the
underlying h5 file). To avoid AttributeError in train.py, all datasets
now are closed at the end of training. This should not break the already
weird behaviour of crashing at the end of training for the already
existing saved datasets.
  • Loading branch information
Michalaq committed Feb 6, 2018
1 parent 00b032c commit dab2ec7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ def __getitem__(self, item):
# print(data[0])
return torch.from_numpy(datapoint.astype('float32'))

def close(self):
pass


class OldH5Dataset(DepthDataset):

Expand Down

0 comments on commit dab2ec7

Please sign in to comment.