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
9ff1b4e8
Commit
9ff1b4e8
authored
Jul 04, 2017
by
vabh
Browse files
fix flake8 errors
parent
9958ecbe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
torchvision/datasets/svhn.py
torchvision/datasets/svhn.py
+4
-4
No files found.
torchvision/datasets/svhn.py
View file @
9ff1b4e8
...
@@ -67,15 +67,15 @@ class SVHN(data.Dataset):
...
@@ -67,15 +67,15 @@ class SVHN(data.Dataset):
self
.
data
=
loaded_mat
[
'X'
]
self
.
data
=
loaded_mat
[
'X'
]
# loading from the .mat file gives an np array of type np.uint8
# loading from the .mat file gives an np array of type np.uint8
# converting to np.int64, so that we have a LongTensor after
# converting to np.int64, so that we have a LongTensor after
# the conversion from the numpy array
# the conversion from the numpy array
# the squeeze is needed to obtain a 1D tensor
# the squeeze is needed to obtain a 1D tensor
self
.
labels
=
loaded_mat
[
'y'
].
astype
(
np
.
int64
).
squeeze
()
self
.
labels
=
loaded_mat
[
'y'
].
astype
(
np
.
int64
).
squeeze
()
# the svhn dataset assigns the class label "10" to the digit 0
# the svhn dataset assigns the class label "10" to the digit 0
# this makes it inconsistent with several loss functions
# this makes it inconsistent with several loss functions
# which expect the class labels to be in the range [0, C-1]
# which expect the class labels to be in the range [0, C-1]
np
.
place
(
self
.
labels
,
self
.
labels
==
10
,
0
)
np
.
place
(
self
.
labels
,
self
.
labels
==
10
,
0
)
self
.
data
=
np
.
transpose
(
self
.
data
,
(
3
,
2
,
0
,
1
))
self
.
data
=
np
.
transpose
(
self
.
data
,
(
3
,
2
,
0
,
1
))
def
__getitem__
(
self
,
index
):
def
__getitem__
(
self
,
index
):
...
...
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