class_docstr: This callback allows counting model parameters during training.
  The output is printed to the console and can be retrieved from the log files.
class_docstr_tok: ["This","callback","allows","counting","model","parameters","during","training",".","The","output","is","printed","to","the","console","and","can","be","retrieved","from","the","log","files","."]
code: def on_pretrain_routine_start(
      self, trainer: Trainer, pl_module: LightningModule
  ) -> None:
      # compute number of model params
      model_total_params = sum(
          p.numel() for p in pl_module.model.parameters()
      )
      model_total_trainable_params = sum(
          p.numel()
          for p in pl_module.model.parameters()
          if p.requires_grad
      )
  
      # log
      print("\n" + f"model_total_params: {model_total_params},")
      print(
          "\n"
          + f"model_total_trainable_params: {model_total_trainable_params},"
      )
  
imports: from pytorch_lightning import Callback, Trainer, LightningModule
label_desc: Use image node_id 2 for calling the ParameterCountCallback obj's underlying member method code with example usage: obj.on_pretrain_routine_start(trainer, pl_module) without return types