pytorch_generative/trainer.py
def plot_images_grid(x: torch.tensor, export_img, title: str = '', nrow=8, padding=2, normalize=True,
                             pad_value=0):
            """Plot 4D Tensor of images of shape (B x C x H x W) as a grid."""

            grid = torchvision.utils.make_grid(x, nrow=nrow, padding=padding, normalize=normalize, pad_value=pad_value)
            npgrid = grid.cpu().numpy()
            im = np.transpose(npgrid, (1, 2, 0))
            plt.imsave(export_img, im)
Plot 4D Tensor of images of shape (B x C x H x W) as a grid.
Plot 4D Tensor of images of shape (B x C x H x W) as a grid.
Plot 4D Tensor of images of shape ( B x C x H x W ) as a grid .
def plot_images_grid(x: torch.tensor, export_img, title: str = '', nrow=8, padding=2, normalize=True,
                             pad_value=0):
            grid = torchvision.utils.make_grid(x, nrow=nrow, padding=padding, normalize=normalize, pad_value=pad_value)
            npgrid = grid.cpu().numpy()
            im = np.transpose(npgrid, (1, 2, 0))
            plt.imsave(export_img, im)
def plot_images_grid ( x : torch . tensor , export_img , title : str = '' , nrow = 8 , padding = 2 , normalize = True , pad_value = 0 ) : grid = torchvision . utils . make_grid ( x , nrow = nrow , padding = padding , normalize = normalize , pad_value = pad_value ) npgrid = grid . cpu ( ) . numpy ( ) im = np . transpose ( npgrid , ( 1 , 2 , 0 ) ) plt . imsave ( export_img , im )
Plot 4D Tensor of images of shape (B x C x H x W) as a grid.
Plot 4D Tensor of images of shape ( B x C x H x W ) as a grid .
"""Plot 4D Tensor of images of shape (B x C x H x W) as a grid."""
x
torch.tensor
export_img
title
str
nrow
padding
normalize
pad_value