class_docstr: This profiler uses Python's cProfiler to record more detailed information about time spent in each function call
  recorded during a given action.
  
  The output is quite verbose and you should only use this if you want very detailed reports.
docstr: Args:
      dirpath: Directory path for the ``filename``. If ``dirpath`` is ``None`` but ``filename`` is present, the
          ``trainer.log_dir`` (from :class:`~lightning.pytorch.loggers.tensorboard.TensorBoardLogger`)
          will be used.
  
      filename: If present, filename where the profiler results will be saved instead of printing to stdout.
          The ``.txt`` extension will be used automatically.
  
      line_count_restriction: this can be used to limit the number of functions
          reported for each action. either an integer (to select a count of lines),
          or a decimal fraction between 0.0 and 1.0 inclusive (to select a percentage of lines)
  
  Raises:
      ValueError:
          If you attempt to stop recording an action which was never started.
docstr_tok: ["Args",":","dirpath",":","Directory","path","for","the","``","filename","``",".","If","``","dirpath","``","is","``","None","``","but","``","filename","``","is","present",",","the","``","trainer.log_dir","``","(","from",":","class",":","`","~lightning.pytorch.loggers.tensorboard.TensorBoardLogger","`",")","will","be","used",".","filename",":","If","present",",","filename","where","the","profiler","results","will","be","saved","instead","of","printing","to","stdout",".","The","``",".txt","``","extension","will","be","used","automatically",".","line_count_restriction",":","this","can","be","used","to","limit","the","number","of","functions","reported","for","each","action",".","either","an","integer","(","to","select","a","count","of","lines",")",",","or","a","decimal","fraction","between","0.0","and","1.0","inclusive","(","to","select","a","percentage","of","lines",")","Raises",":","ValueError",":","If","you","attempt","to","stop","recording","an","action","which","was","never","started","."]
code: def __init__(
      self,
      dirpath: Optional[Union[str, Path]] = None,
      filename: Optional[str] = None,
      line_count_restriction: float = 1.0,
  ) -> None:
      """
      Args:
          dirpath: Directory path for the ``filename``. If ``dirpath`` is ``None`` but ``filename`` is present, the
              ``trainer.log_dir`` (from :class:`~lightning.pytorch.loggers.tensorboard.TensorBoardLogger`)
              will be used.
  
          filename: If present, filename where the profiler results will be saved instead of printing to stdout.
              The ``.txt`` extension will be used automatically.
  
          line_count_restriction: this can be used to limit the number of functions
              reported for each action. either an integer (to select a count of lines),
              or a decimal fraction between 0.0 and 1.0 inclusive (to select a percentage of lines)
  
      Raises:
          ValueError:
              If you attempt to stop recording an action which was never started.
      """
      super().__init__(dirpath=dirpath, filename=filename)
      self.profiled_actions: Dict[str, cProfile.Profile] = {}
      self.line_count_restriction = line_count_restriction
  
file_path: pytorch-lightning/src/lightning/pytorch/profilers/advanced.py
imports: import cProfile
  import io
  import logging
  import pstats
  from pathlib import Path
  from typing import Dict, Optional, Tuple, Union
  from typing_extensions import override
  from lightning.pytorch.profilers.profiler import Profiler
label_desc: Use image node_id 1 to create a new AdvancedProfiler object from inherited base classes: Profiler with example: obj = AdvancedProfiler(dirpath, filename, line_count_restriction)