class_docstr: Log model graph to respective logger.
class_docstr_tok: ["Log","model","graph","to","respective","logger","."]
docstr: Log model graph to respective logger.
  
  Args:
      trainer: Trainer object which contans reference to loggers.
      pl_module: LightningModule object which is logged.
docstr_tok: ["Log","model","graph","to","respective","logger",".","Args",":","trainer",":","Trainer","object","which","contans","reference","to","loggers",".","pl_module",":","LightningModule","object","which","is","logged","."]
code: def on_train_start(
      self, trainer: Trainer, pl_module: LightningModule
  ) -> None:
      """Log model graph to respective logger.
  
      Args:
          trainer: Trainer object which contans reference to loggers.
          pl_module: LightningModule object which is logged.
      """
  
      for logger in trainer.loggers:
          if isinstance(logger, AnomalibWandbLogger):
              # NOTE: log graph gets populated only after one backward pass. This won't work for models which do not
              # require training such as Padim
              logger.watch(pl_module, log_graph=True, log="all")
              break
  
imports: import torch
  from pytorch_lightning import Callback, LightningModule, Trainer
  from anomalib.utils.loggers import AnomalibCometLogger, AnomalibTensorBoardLogger, AnomalibWandbLogger
label_desc: Use image node_id 1 for calling the GraphLogger obj's underlying member method code with example usage: obj.on_train_start(trainer, pl_module) without return types