Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
834ac30a
Commit
834ac30a
authored
Feb 27, 2017
by
Luke Yeager
Committed by
Soumith Chintala
Feb 27, 2017
Browse files
[Lint] Fix remaining lint manually
parent
a137e4f4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
7 deletions
+9
-7
test/test_transforms.py
test/test_transforms.py
+1
-0
torchvision/datasets/cifar.py
torchvision/datasets/cifar.py
+2
-2
torchvision/datasets/lsun.py
torchvision/datasets/lsun.py
+3
-2
torchvision/datasets/mnist.py
torchvision/datasets/mnist.py
+2
-2
torchvision/transforms.py
torchvision/transforms.py
+1
-1
No files found.
test/test_transforms.py
View file @
834ac30a
...
@@ -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
()
torchvision/datasets/cifar.py
View file @
834ac30a
...
@@ -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
:
...
...
torchvision/datasets/lsun.py
View file @
834ac30a
...
@@ -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
)
...
...
torchvision/datasets/mnist.py
View file @
834ac30a
...
@@ -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
(
...
...
torchvision/transforms.py
View file @
834ac30a
...
@@ -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
typ
e
(
lambd
)
is
types
.
LambdaType
assert
isinstanc
e
(
lambd
,
types
.
LambdaType
)
self
.
lambd
=
lambd
self
.
lambd
=
lambd
def
__call__
(
self
,
img
):
def
__call__
(
self
,
img
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment