def sample_image(opt, n_row, batches_done, generator, FloatTensor, LongTensor):
    z = Variable(FloatTensor(np.random.normal(0, 1, ((n_row ** 2), opt.latent_dim))))
    labels = np.array([num for _ in range(n_row) for num in range(n_row)])
    labels = Variable(LongTensor(labels))
    gen_imgs = generator(z, labels)
    save_image(gen_imgs.data, ('images/%d.png' % batches_done), nrow=n_row, normalize=True)
def sample_image(opt, n_row, batches_done, generator, FloatTensor, LongTensor):
    z = Variable(FloatTensor(np.random.normal(0, 1, ((n_row ** 2), opt.latent_dim))))
    labels = np.array([num for _ in range(n_row) for num in range(n_row)])
    labels = Variable(LongTensor(labels))
    gen_imgs = generator(z, labels)
    save_image(gen_imgs.data, ('images/%d.png' % batches_done), nrow=n_row, normalize=True)