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
ModelZoo
ResNet50_tensorflow
Commits
96e2c0ee
Commit
96e2c0ee
authored
Jan 22, 2018
by
Neal Wu
Browse files
Fix some spacing
parent
d90d5280
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
official/mnist/dataset.py
official/mnist/dataset.py
+3
-3
No files found.
official/mnist/dataset.py
View file @
96e2c0ee
...
...
@@ -33,7 +33,7 @@ def read32(bytestream):
def
check_image_file_header
(
filename
):
"""Validate that filename corresponds to images for the MNIST dataset."""
with
tf
.
gfile
.
Open
(
filename
,
'rb'
)
as
f
:
with
tf
.
gfile
.
Open
(
filename
,
'rb'
)
as
f
:
magic
=
read32
(
f
)
num_images
=
read32
(
f
)
rows
=
read32
(
f
)
...
...
@@ -49,7 +49,7 @@ def check_image_file_header(filename):
def
check_labels_file_header
(
filename
):
"""Validate that filename corresponds to labels for the MNIST dataset."""
with
tf
.
gfile
.
Open
(
filename
,
'rb'
)
as
f
:
with
tf
.
gfile
.
Open
(
filename
,
'rb'
)
as
f
:
magic
=
read32
(
f
)
num_items
=
read32
(
f
)
if
magic
!=
2049
:
...
...
@@ -58,7 +58,7 @@ def check_labels_file_header(filename):
def
download
(
directory
,
filename
):
"""Download (and unzip) a file from the MNIST dataset
,
if
it doesn'
t already
exist
."""
"""Download (and unzip) a file from the MNIST dataset if
no
t already
done
."""
filepath
=
os
.
path
.
join
(
directory
,
filename
)
if
tf
.
gfile
.
Exists
(
filepath
):
return
filepath
...
...
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