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
cd77d17a
"vscode:/vscode.git/clone" did not exist on "2cae2907b6c07f83aa6a17ca5b475df574896e7b"
Unverified
Commit
cd77d17a
authored
Apr 07, 2020
by
Philip Meier
Committed by
GitHub
Apr 07, 2020
Browse files
format signatures with black (#2070)
parent
9a3afff4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
+20
-7
torchvision/utils.py
torchvision/utils.py
+20
-7
No files found.
torchvision/utils.py
View file @
cd77d17a
...
...
@@ -6,10 +6,15 @@ import math
irange
=
range
def
make_grid
(
tensor
:
Union
[
torch
.
Tensor
,
Sequence
[
torch
.
Tensor
]],
nrow
:
int
=
8
,
padding
:
int
=
2
,
normalize
:
bool
=
False
,
range
:
Optional
[
Tuple
[
int
,
int
]]
=
None
,
scale_each
:
bool
=
False
,
pad_value
:
int
=
0
)
->
torch
.
Tensor
:
def
make_grid
(
tensor
:
Union
[
torch
.
Tensor
,
Sequence
[
torch
.
Tensor
]],
nrow
:
int
=
8
,
padding
:
int
=
2
,
normalize
:
bool
=
False
,
range
:
Optional
[
Tuple
[
int
,
int
]]
=
None
,
scale_each
:
bool
=
False
,
pad_value
:
int
=
0
,
)
->
torch
.
Tensor
:
"""Make a grid of images.
Args:
...
...
@@ -93,9 +98,17 @@ def make_grid(tensor: Union[torch.Tensor, Sequence[torch.Tensor]], nrow: int = 8
return
grid
def
save_image
(
tensor
:
Union
[
torch
.
Tensor
,
Sequence
[
torch
.
Tensor
]],
fp
:
Union
[
Text
,
pathlib
.
Path
,
BinaryIO
],
nrow
:
int
=
8
,
padding
:
int
=
2
,
normalize
:
bool
=
False
,
range
:
Optional
[
Tuple
[
int
,
int
]]
=
None
,
scale_each
:
bool
=
False
,
pad_value
:
int
=
0
,
format
:
Optional
[
str
]
=
None
)
->
None
:
def
save_image
(
tensor
:
Union
[
torch
.
Tensor
,
Sequence
[
torch
.
Tensor
]],
fp
:
Union
[
Text
,
pathlib
.
Path
,
BinaryIO
],
nrow
:
int
=
8
,
padding
:
int
=
2
,
normalize
:
bool
=
False
,
range
:
Optional
[
Tuple
[
int
,
int
]]
=
None
,
scale_each
:
bool
=
False
,
pad_value
:
int
=
0
,
format
:
Optional
[
str
]
=
None
,
)
->
None
:
"""Save a given Tensor into an image file.
Args:
...
...
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