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
apex
Commits
a109f856
"src/libtorio/ffmpeg/stream_reader/conversion.cpp" did not exist on "155d1baeb22ecbcd8f15c86a76918c35dc1b754b"
Unverified
Commit
a109f856
authored
Sep 28, 2020
by
ptrblck
Committed by
GitHub
Sep 28, 2020
Browse files
use reshape instead of view (#971)
parent
4a1fa2c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
examples/imagenet/main_amp.py
examples/imagenet/main_amp.py
+1
-1
No files found.
examples/imagenet/main_amp.py
View file @
a109f856
...
...
@@ -527,7 +527,7 @@ def accuracy(output, target, topk=(1,)):
res
=
[]
for
k
in
topk
:
correct_k
=
correct
[:
k
].
view
(
-
1
).
float
().
sum
(
0
,
keepdim
=
True
)
correct_k
=
correct
[:
k
].
reshape
(
-
1
).
float
().
sum
(
0
,
keepdim
=
True
)
res
.
append
(
correct_k
.
mul_
(
100.0
/
batch_size
))
return
res
...
...
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