I am trying to do the exact same thing (run CTGAN in a differentially private manner using opacus). I have the original code of CTGAN (same as shown above) but just changed the optimizerD by attaching PrivacyEngine to it (no other changes).
And I get the exact same error at loss_d.backward().
When I print loss_d just before the backward call, I get this tensor(-0.0344, grad_fn=<NegBackward>).
I do not see any other backward call before this step, so am puzzled as to why this is happening.