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
0e8d4226
Commit
0e8d4226
authored
Mar 28, 2017
by
Huan Yang
Committed by
Soumith Chintala
Mar 27, 2017
Browse files
Fixed border missing on bottom and right side using make_grid (#129)
parent
1f085a0e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
torchvision/utils.py
torchvision/utils.py
+1
-1
No files found.
torchvision/utils.py
View file @
0e8d4226
...
@@ -65,7 +65,7 @@ def make_grid(tensor, nrow=8, padding=2,
...
@@ -65,7 +65,7 @@ def make_grid(tensor, nrow=8, padding=2,
xmaps
=
min
(
nrow
,
nmaps
)
xmaps
=
min
(
nrow
,
nmaps
)
ymaps
=
int
(
math
.
ceil
(
float
(
nmaps
)
/
xmaps
))
ymaps
=
int
(
math
.
ceil
(
float
(
nmaps
)
/
xmaps
))
height
,
width
=
int
(
tensor
.
size
(
2
)
+
padding
),
int
(
tensor
.
size
(
3
)
+
padding
)
height
,
width
=
int
(
tensor
.
size
(
2
)
+
padding
),
int
(
tensor
.
size
(
3
)
+
padding
)
grid
=
tensor
.
new
(
3
,
height
*
ymaps
,
width
*
xmaps
).
fill_
(
0
)
grid
=
tensor
.
new
(
3
,
height
*
ymaps
+
1
+
padding
//
2
,
width
*
xmaps
+
1
+
padding
//
2
).
fill_
(
0
)
k
=
0
k
=
0
for
y
in
irange
(
ymaps
):
for
y
in
irange
(
ymaps
):
for
x
in
irange
(
xmaps
):
for
x
in
irange
(
xmaps
):
...
...
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