Hi,
The problem is in how we handle elements that should return 0 gradients in cpp.
As a workaround, you can modify your calc_gradient_penalty with:
def calc_gradient_penalty(self, real_data, fake_data,lambd):
    alpha = torch.rand(real_data.size(0), 1,1,1)
    alpha = alpha.expand(real_data.size())
    alpha = alpha

    interpolates = alpha * real_data.data + ((1 - alpha) * fake_data.data)

    interpolates = interpolates
    interpolates = Variable(interpolates, requires_grad=True)

    disc_interpolates = self(interpolates)

    inputs = [interpolates] + list(self.parameters())

    gradients = autograd.grad(outputs=disc_interpolates, inputs=inputs,
                              grad_outputs=torch.ones(disc_interpolates.size()),
                              create_graph=True, retain_graph=True, only_inputs=True)

    gradient_penalty = ((gradients[0].norm(2, dim=1) - 1) ** 2).mean() * lambd
    for grad in gradients[1:]:
        gradient_penalty += 0 * grad.view(-1)[0]

    return gradient_penalty

This basically make sure that all gradients exist (even though they will be 0).
The issue tracking this problem is #2003 13.