Commit 834ac30a authored by Luke Yeager's avatar Luke Yeager Committed by Soumith Chintala
Browse files

[Lint] Fix remaining lint manually

parent a137e4f4
...@@ -155,5 +155,6 @@ class Tester(unittest.TestCase): ...@@ -155,5 +155,6 @@ class Tester(unittest.TestCase):
l, = img.split() l, = img.split()
assert np.allclose(l, img_data[:, :, 0]) assert np.allclose(l, img_data[:, :, 0])
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -39,8 +39,8 @@ class CIFAR10(data.Dataset): ...@@ -39,8 +39,8 @@ class CIFAR10(data.Dataset):
self.download() self.download()
if not self._check_integrity(): if not self._check_integrity():
raise RuntimeError('Dataset not found or corrupted.' raise RuntimeError('Dataset not found or corrupted.' +
+ ' You can use download=True to download it') ' You can use download=True to download it')
# now load the picked numpy arrays # now load the picked numpy arrays
if self.train: if self.train:
......
...@@ -128,9 +128,10 @@ class LSUN(data.Dataset): ...@@ -128,9 +128,10 @@ class LSUN(data.Dataset):
def __repr__(self): def __repr__(self):
return self.__class__.__name__ + ' (' + self.db_path + ')' return self.__class__.__name__ + ' (' + self.db_path + ')'
if __name__ == '__main__': if __name__ == '__main__':
#lsun = LSUNClass(db_path='/home/soumith/local/lsun/train/bedroom_train_lmdb') # lsun = LSUNClass(db_path='/home/soumith/local/lsun/train/bedroom_train_lmdb')
#a = lsun[0] # a = lsun[0]
lsun = LSUN(db_path='/home/soumith/local/lsun/train', lsun = LSUN(db_path='/home/soumith/local/lsun/train',
classes=['bedroom_train', 'church_outdoor_train']) classes=['bedroom_train', 'church_outdoor_train'])
print(lsun.classes) print(lsun.classes)
......
...@@ -32,8 +32,8 @@ class MNIST(data.Dataset): ...@@ -32,8 +32,8 @@ class MNIST(data.Dataset):
self.download() self.download()
if not self._check_exists(): if not self._check_exists():
raise RuntimeError('Dataset not found.' raise RuntimeError('Dataset not found.' +
+ ' You can use download=True to download it') ' You can use download=True to download it')
if self.train: if self.train:
self.train_data, self.train_labels = torch.load( self.train_data, self.train_labels = torch.load(
......
...@@ -155,7 +155,7 @@ class Lambda(object): ...@@ -155,7 +155,7 @@ class Lambda(object):
"""Applies a lambda as a transform.""" """Applies a lambda as a transform."""
def __init__(self, lambd): def __init__(self, lambd):
assert type(lambd) is types.LambdaType assert isinstance(lambd, types.LambdaType)
self.lambd = lambd self.lambd = lambd
def __call__(self, img): def __call__(self, img):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment