class_docstr: Callback to handle GAN Training.
class_docstr_tok: ["Callback","to","handle","GAN","Training","."]
docstr: Switch the model and loss function, if `gen_mode` is provided, in the desired mode.
docstr_tok: ["Switch","the","model","and","loss","function",",","if","`","gen_mode","`","is","provided",",","in","the","desired","mode","."]
code: def switch(self, gen_mode=None):
      "Switch the model and loss function, if `gen_mode` is provided, in the desired mode."
      self.gen_mode = (
          (not self.gen_mode) if gen_mode is None else gen_mode
      )
      self._set_trainable()
      self.model.switch(gen_mode)
      self.loss_func.switch(gen_mode)
  
imports: from __future__ import annotations
  from ..basics import *
  from .all import *
label_desc: Use image node_id 8 for calling the GANTrainer obj's underlying member method code with example usage: obj.switch(gen_mode) without return types