This is my code for question6,
noise=get_noise(num_images, z_dim, device)
fimage=gen(noise),
pred=disc(fimage),
def get_noise(n_samples, z_dim, device=‘cpu’):
return torch.randn(n_samples,z_dim).to(device)
And I got this error, could anyone help me with it?
33 noise=get_noise(num_images, z_dim, device),
—> 34 fimage=gen(noise),
TypeError: zeros_like() received an invalid combination of arguments - got (tuple), but expected one of:
- (Tensor input, torch.memory_format memory_format, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)
- (Tensor input, torch.memory_format memory_format, bool requires_grad)