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
fb83430f
"vscode:/vscode.git/clone" did not exist on "463eab6b5d6afff79a4bc8fd216bba4f9048d9a5"
Commit
fb83430f
authored
Dec 04, 2017
by
Yashas Annadani
Committed by
Alykhan Tejani
Dec 03, 2017
Browse files
Fixes #349 (#355)
parent
c9b89145
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
torchvision/utils.py
torchvision/utils.py
+1
-2
No files found.
torchvision/utils.py
View file @
fb83430f
...
@@ -93,9 +93,8 @@ def save_image(tensor, filename, nrow=8, padding=2,
...
@@ -93,9 +93,8 @@ def save_image(tensor, filename, nrow=8, padding=2,
**kwargs: Other arguments are documented in ``make_grid``.
**kwargs: Other arguments are documented in ``make_grid``.
"""
"""
from
PIL
import
Image
from
PIL
import
Image
tensor
=
tensor
.
cpu
()
grid
=
make_grid
(
tensor
,
nrow
=
nrow
,
padding
=
padding
,
pad_value
=
pad_value
,
grid
=
make_grid
(
tensor
,
nrow
=
nrow
,
padding
=
padding
,
pad_value
=
pad_value
,
normalize
=
normalize
,
range
=
range
,
scale_each
=
scale_each
)
normalize
=
normalize
,
range
=
range
,
scale_each
=
scale_each
)
ndarr
=
grid
.
mul
(
255
).
clamp
(
0
,
255
).
byte
().
permute
(
1
,
2
,
0
).
numpy
()
ndarr
=
grid
.
mul
(
255
).
clamp
(
0
,
255
).
byte
().
permute
(
1
,
2
,
0
).
cpu
().
numpy
()
im
=
Image
.
fromarray
(
ndarr
)
im
=
Image
.
fromarray
(
ndarr
)
im
.
save
(
filename
)
im
.
save
(
filename
)
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