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
c0cd903d
Unverified
Commit
c0cd903d
authored
Feb 13, 2019
by
Francisco Massa
Committed by
GitHub
Feb 13, 2019
Browse files
Add deprecation warning in MNIST train[test]_labels[data] (#742)
parent
680c7459
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
torchvision/datasets/mnist.py
torchvision/datasets/mnist.py
+21
-0
No files found.
torchvision/datasets/mnist.py
View file @
c0cd903d
from
__future__
import
print_function
from
__future__
import
print_function
import
warnings
import
torch.utils.data
as
data
import
torch.utils.data
as
data
from
PIL
import
Image
from
PIL
import
Image
import
os
import
os
...
@@ -37,6 +38,26 @@ class MNIST(data.Dataset):
...
@@ -37,6 +38,26 @@ class MNIST(data.Dataset):
classes
=
[
'0 - zero'
,
'1 - one'
,
'2 - two'
,
'3 - three'
,
'4 - four'
,
classes
=
[
'0 - zero'
,
'1 - one'
,
'2 - two'
,
'3 - three'
,
'4 - four'
,
'5 - five'
,
'6 - six'
,
'7 - seven'
,
'8 - eight'
,
'9 - nine'
]
'5 - five'
,
'6 - six'
,
'7 - seven'
,
'8 - eight'
,
'9 - nine'
]
@
property
def
train_labels
(
self
):
warnings
.
warn
(
"train_labels has been renamed targets"
)
return
self
.
targets
@
property
def
test_labels
(
self
):
warnings
.
warn
(
"test_labels has been renamed targets"
)
return
self
.
targets
@
property
def
train_data
(
self
):
warnings
.
warn
(
"train_data has been renamed data"
)
return
self
.
data
@
property
def
test_data
(
self
):
warnings
.
warn
(
"test_data has been renamed data"
)
return
self
.
data
def
__init__
(
self
,
root
,
train
=
True
,
transform
=
None
,
target_transform
=
None
,
download
=
False
):
def
__init__
(
self
,
root
,
train
=
True
,
transform
=
None
,
target_transform
=
None
,
download
=
False
):
self
.
root
=
os
.
path
.
expanduser
(
root
)
self
.
root
=
os
.
path
.
expanduser
(
root
)
self
.
transform
=
transform
self
.
transform
=
transform
...
...
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