code: def summary(self) -> str:
      if (
          not self._profiler_kwargs.get("enabled", True)
          or self._emit_nvtx
      ):
          return ""
  
      self._delete_profilers()
  
      if not self.function_events:
          return ""
  
      if self._export_to_chrome and not _KINETO_AVAILABLE:
          filename = f"{self.local_rank}_trace.json"
          path_to_trace = (
              filename
              if self.dirpath is None
              else os.path.join(self.dirpath, filename)
          )
          self.function_events.export_chrome_trace(path_to_trace)
  
      data = self.function_events.key_averages(
          group_by_input_shapes=self._group_by_input_shapes
      )
      table = data.table(
          sort_by=self._sort_by_key,
          row_limit=self._row_limit,
          **self._table_kwargs,
      )
  
      recorded_stats = {"records": table}
      return self._stats_to_str(recorded_stats)
  
imports: import inspect
  import logging
  import os
  from functools import lru_cache, partial
  from pathlib import Path
  from typing import TYPE_CHECKING, Any, Callable, ContextManager, Dict, List, Optional, Type, Union
  import torch
  from torch import Tensor, nn
  from torch.autograd.profiler import EventList, record_function
  from torch.profiler import ProfilerAction, ProfilerActivity, tensorboard_trace_handler
  from torch.utils.hooks import RemovableHandle
  from typing_extensions import override
  from lightning.fabric.accelerators.cuda import is_cuda_available
  from lightning.pytorch.profilers.profiler import Profiler
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from lightning.pytorch.utilities.rank_zero import WarningCache, rank_zero_warn
label_desc: Use image node_id 9 for calling the PyTorchProfiler obj's underlying member method code with example usage: obj.summary() and returns: self, str, str