def METHOD_NAME(self, data):
    self.optimizer_D.zero_grad()
    d_losses = self.pix2pix_model.forward(data=data, mode='discriminator')
    if self.opt.train_rotate:
        d_rotated_losses = self.pix2pix_model.forward(data=data, mode='discriminator_rotated')
        d_losses['D_rotate_Fake'] = d_rotated_losses['D_Fake']
        d_losses['D_rotate_real'] = d_rotated_losses['D_real']
    d_loss = sum(d_losses.values()).mean()
    d_loss.backward()
    self.optimizer_D.step()
    self.d_losses = d_losses