class_docstr: Callback to handle GAN Training.
class_docstr_tok: ["Callback","to","handle","GAN","Training","."]
docstr: Record `last_loss` in the proper list.
docstr_tok: ["Record","`","last_loss","`","in","the","proper","list","."]
code: def after_batch(self):
      "Record `last_loss` in the proper list."
      if not self.training:
          return
      if self.gen_mode:
          self.gen_loss.accumulate(self.learn)
          self.gen_losses.append(self.gen_loss.value)
          self.last_gen = self.learn.to_detach(self.pred)
      else:
          self.crit_loss.accumulate(self.learn)
          self.crit_losses.append(self.crit_loss.value)
  
imports: from __future__ import annotations
  from ..basics import *
  from .all import *
label_desc: Use image node_id 6 for calling the GANTrainer obj's underlying member method code with example usage: obj.after_batch() without return types