Strange things, but code work only in case, when critic_loss.backward(create_graph=True). grad(outputs=disc_interpolates, inputs=interpolates, grad_outputs=torch.ones_like(disc_interpolates), create_graph=True)[0] doesn’t work and still raise Trying to backward through the graph a second time, but the buffers have already been freed. Specify retain_graph=True when calling backward the first time.