class_docstr: If you wish to write a custom profiler, you should inherit from this class.
docstr: Execute arbitrary pre-profiling set-up steps.
docstr_tok: ["Execute","arbitrary","pre-profiling","set-up","steps","."]
code: def setup(
      self,
      stage: str,
      local_rank: Optional[int] = None,
      log_dir: Optional[str] = None,
  ) -> None:
      """Execute arbitrary pre-profiling set-up steps."""
      self._stage = stage
      self._local_rank = local_rank
      self.dirpath = self.dirpath or log_dir
  
imports: import logging
  import os
  from abc import ABC, abstractmethod
  from contextlib import contextmanager
  from pathlib import Path
  from typing import Any, Callable, Dict, Generator, Optional, TextIO, Union
  from lightning.fabric.utilities.cloud_io import get_filesystem
label_desc: Use image node_id 11 for calling the Profiler obj's underlying member method code with example usage: obj.setup(stage, local_rank, log_dir) without return types