The pretained model from torch hub only generates ones. For example, I tried to generate 8s using the following code, and after displaying all the images, they were all ones:
mnist_cgan = torch.hub.load("Lornatang/CGAN-PyTorch", "cgan", pretrained=True, progress=True, verbose=False)
mnist_cgan.eval()
mnist_cgan.to(device)
num_8s = 10
noise = torch.randn([num_8s, 100], device=device)
conditional = 8 * torch.ones((num_8s,), device=device, dtype=torch.int32)
with torch.no_grad():
generated_images = mnist_cgan(noise, conditional).squeeze().cpu().numpy()