Commit 0e8d4226 authored by Huan Yang's avatar Huan Yang Committed by Soumith Chintala
Browse files

Fixed border missing on bottom and right side using make_grid (#129)

parent 1f085a0e
...@@ -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):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment