code: def __init__(
      self, name: str = "resnet18", automatic_optimization: bool = True
  ):
      super().__init__()
      self.model = get_torchvision_model(name, weights="DEFAULT")
      self.criterion = torch.nn.CrossEntropyLoss()
      self.automatic_optimization = automatic_optimization
      self.training_step = (
          self.automatic_optimization_training_step
          if automatic_optimization
          else self.manual_optimization_training_step
      )
  
imports: from os import path
  import torch
  import torchvision
  import torchvision.transforms
  from lightning.pytorch import LightningDataModule, LightningModule, cli_lightning_logo
  from lightning.pytorch.cli import LightningCLI
  from lightning.pytorch.profilers.pytorch import PyTorchProfiler
  from lightning.pytorch.utilities.model_helpers import get_torchvision_model
label_desc: Use image node_id 1 to create a new ModelToProfile object from inherited base classes: LightningModule with example: obj = ModelToProfile(name, automatic_optimization)