class_docstr: Implementation of a configurable command line tool for pytorch-lightning.
class_docstr_tok: ["Implementation","of","a","configurable","command","line","tool","for","pytorch-lightning","."]
docstr: Instantiates the trainer using self.config_init['trainer']
code: def instantiate_trainer(self) -> None:
      """Instantiates the trainer using self.config_init['trainer']"""
      if self.config_init["trainer"].get("callbacks") is None:
          self.config_init["trainer"]["callbacks"] = []
      callbacks = [
          self.config_init[c] for c in self.parser.callback_keys
      ]
      self.config_init["trainer"]["callbacks"].extend(callbacks)
      if "callbacks" in self.trainer_defaults:
          if isinstance(self.trainer_defaults["callbacks"], list):
              self.config_init["trainer"]["callbacks"].extend(
                  self.trainer_defaults["callbacks"]
              )
          else:
              self.config_init["trainer"]["callbacks"].append(
                  self.trainer_defaults["callbacks"]
              )
      if (
          self.save_config_callback
          and not self.config_init["trainer"]["fast_dev_run"]
      ):
          config_callback = self.save_config_callback(
              self.parser,
              self.config,
              self.save_config_filename,
              overwrite=self.save_config_overwrite,
          )
          self.config_init["trainer"]["callbacks"].append(
              config_callback
          )
      self.trainer = self.trainer_class(**self.config_init["trainer"])
  
imports: import inspect
  import os
  import warnings
  from argparse import Namespace
  from types import MethodType
  from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union, cast
  import torch
  from jsonargparse import ActionConfigFile, ArgumentParser, class_from_function, set_config_read_mode
  from pytorch_lightning import LightningDataModule, LightningModule, Trainer
  from pytorch_lightning.callbacks import Callback
  from pytorch_lightning.utilities.cloud_io import get_filesystem
  from pytorch_lightning.utilities.model_helpers import is_overridden
  from pytorch_lightning.utilities.seed import seed_everything
  from torch.optim import Optimizer
label_desc: Use image node_id 9 for calling the LightningCLI obj's underlying member method code with example usage: obj.instantiate_trainer() without return types