class_docstr: Callback to handle GAN Training.
class_docstr_tok: ["Callback","to","handle","GAN","Training","."]
docstr: Appropriately set the generator and critic into a trainable or loss evaluation mode based on `self.gen_mode`.
docstr_tok: ["Appropriately","set","the","generator","and","critic","into","a","trainable","or","loss","evaluation","mode","based","on","`","self.gen_mode","`","."]
code: def _set_trainable(self):
      "Appropriately set the generator and critic into a trainable or loss evaluation mode based on `self.gen_mode`."
      train_model = self.generator if self.gen_mode else self.critic
      loss_model = self.generator if not self.gen_mode else self.critic
      set_freeze_model(train_model, True)
      set_freeze_model(loss_model, False)
      if self.switch_eval:
          train_model.train()
          loss_model.eval()
  
imports: from __future__ import annotations
  from ..basics import *
  from .all import *
label_desc: Use image node_id 2 for calling the GANTrainer obj's underlying member method code with example usage: obj._set_trainable() without return types