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
4aff146c
"examples/pytorch/git@developer.sourcefind.cn:OpenDAS/dgl.git" did not exist on "5b2d44faaaea47c76cdf5d721d1f69eb9c7f620a"
Commit
4aff146c
authored
Jul 26, 2017
by
Keon
Committed by
Soumith Chintala
Jul 27, 2017
Browse files
Return real dataset length (#210)
parent
7842c3ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
torchvision/datasets/mnist.py
torchvision/datasets/mnist.py
+2
-2
No files found.
torchvision/datasets/mnist.py
View file @
4aff146c
...
@@ -81,9 +81,9 @@ class MNIST(data.Dataset):
...
@@ -81,9 +81,9 @@ class MNIST(data.Dataset):
def
__len__
(
self
):
def
__len__
(
self
):
if
self
.
train
:
if
self
.
train
:
return
60000
return
len
(
self
.
train_data
)
else
:
else
:
return
10000
return
len
(
self
.
test_data
)
def
_check_exists
(
self
):
def
_check_exists
(
self
):
return
os
.
path
.
exists
(
os
.
path
.
join
(
self
.
root
,
self
.
processed_folder
,
self
.
training_file
))
and
\
return
os
.
path
.
exists
(
os
.
path
.
join
(
self
.
root
,
self
.
processed_folder
,
self
.
training_file
))
and
\
...
...
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