-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Closed
Description
import torch
import torchvision
label_img = torch.rand(100, 3, 32, 32)
x = torchvision.utils.make_grid(label_img, nrow=20, padding=10)
torchvision.transforms.ToPILImage()(x).save("example.png")
which has 5 rows and 20 columns. Although the docs say
nrow (int, optional) – Number of rows in grid. Final grid size is (B / nrow, nrow). Default is 8.
Which says the output will actually be (B/nrow, nrow)
. Perhaps this param should be called ncol
, or we should change the output shape to be (nrow, B/nrow)
?
I think, to keep backward compatibility changing the output shape to (nrow, B/nrow)
would make more sense.
Happy to send a PR if you agree?
Metadata
Metadata
Assignees
Labels
No labels