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
c332a7f5
Unverified
Commit
c332a7f5
authored
Jul 15, 2021
by
Joe Early
Committed by
GitHub
Jul 15, 2021
Browse files
Removed copy=False in torch.from_numpy in MNIST to avoid warning (#4184)
parent
1e0f7942
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
torchvision/datasets/mnist.py
torchvision/datasets/mnist.py
+1
-1
No files found.
torchvision/datasets/mnist.py
View file @
c332a7f5
...
@@ -496,7 +496,7 @@ def read_sn3_pascalvincent_tensor(path: str, strict: bool = True) -> torch.Tenso
...
@@ -496,7 +496,7 @@ def read_sn3_pascalvincent_tensor(path: str, strict: bool = True) -> torch.Tenso
s
=
[
get_int
(
data
[
4
*
(
i
+
1
):
4
*
(
i
+
2
)])
for
i
in
range
(
nd
)]
s
=
[
get_int
(
data
[
4
*
(
i
+
1
):
4
*
(
i
+
2
)])
for
i
in
range
(
nd
)]
parsed
=
np
.
frombuffer
(
data
,
dtype
=
m
[
1
],
offset
=
(
4
*
(
nd
+
1
)))
parsed
=
np
.
frombuffer
(
data
,
dtype
=
m
[
1
],
offset
=
(
4
*
(
nd
+
1
)))
assert
parsed
.
shape
[
0
]
==
np
.
prod
(
s
)
or
not
strict
assert
parsed
.
shape
[
0
]
==
np
.
prod
(
s
)
or
not
strict
return
torch
.
from_numpy
(
parsed
.
astype
(
m
[
2
]
,
copy
=
False
)).
view
(
*
s
)
return
torch
.
from_numpy
(
parsed
.
astype
(
m
[
2
])).
view
(
*
s
)
def
read_label_file
(
path
:
str
)
->
torch
.
Tensor
:
def
read_label_file
(
path
:
str
)
->
torch
.
Tensor
:
...
...
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