How are these loop nested? Like this:
for i, data in enumerate(all_dataloader):
  # Generate all train_full, generated_y etc
  for j in range(critic_policy(epoch)):
    # The code from your first post

If so, what most likely happens is that netG has some parameters that require gradients. So generated_y_X requires gradients as well.
But this part of the history is shared between the iterations of the inner loop.
This means that when you call backward on the second iteration, you already called backward in netG during the first iteration, and that gives you the error you see.
If you don’t want gradients for netG, you can simply do:
    with torch.no_grad():
        generated_y_1 = netG(torch.cat((noise_1, train_x_1), dim=1))
        generated_full_1 = torch.cat((generated_y_1, train_x_1), dim=1)
        generated_y_2 = netG(torch.cat((noise_2, train_x_2), dim=1))
        generated_full_2 = torch.cat((generated_y_2, train_x_2), dim=1)

That will disable the autograd for the part where you don’t need gradients. And remove the shared part of the graph between iterations.
That will reduce the memory usage of your overall code a lot as well  because you won’t store all the informations necessary to compute the gradients for netG two times even though you don’t want to compute them ever.