Skip to content

Commit 0e8d422

Browse files
yanghuanflcsoumith
authored andcommitted
Fixed border missing on bottom and right side using make_grid (#129)
1 parent 1f085a0 commit 0e8d422

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchvision/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def norm_range(t, range):
6565
xmaps = min(nrow, nmaps)
6666
ymaps = int(math.ceil(float(nmaps) / xmaps))
6767
height, width = int(tensor.size(2) + padding), int(tensor.size(3) + padding)
68-
grid = tensor.new(3, height * ymaps, width * xmaps).fill_(0)
68+
grid = tensor.new(3, height * ymaps + 1 + padding // 2, width * xmaps + 1 + padding // 2).fill_(0)
6969
k = 0
7070
for y in irange(ymaps):
7171
for x in irange(xmaps):

0 commit comments

Comments
 (0)