Solved by Nikronic in post #2 
              
              
                Hi, 
For definining custom losses, you just need to define forward function. Backward function is completely computed by Autograd engine. 
g_loss = generator_criterion(fake_out, fake_img, real_img)


This line is equal to: 
g_loss = generator_criterion.forward(fake_out, fake_img, real_img)

So, expl…