class_docstr: TorchPoints3d Trainer handles the logic between
      - BaseModel,
      - Dataset and its Tracker
      - A custom ModelCheckpoint
      - A custom Visualizer
  It supports MC dropout - multiple voting_runs for val / test datasets
class_docstr_tok: ["TorchPoints3d","Trainer","handles","the","logic","between","-","BaseModel",",","-","Dataset","and","its","Tracker","-","A","custom","ModelCheckpoint","-","A","custom","Visualizer","It","supports","MC","dropout","-","multiple","voting_runs","for","val","\/","test","datasets"]
code: def profiler_profile(self, epoch):
      if self.pytorch_profiler_log and (
          getattr(
              self._cfg.training.tensorboard.pytorch_profiler,
              "nb_epoch",
              3,
          )
          == 0
          or epoch
          <= getattr(
              self._cfg.training.tensorboard.pytorch_profiler,
              "nb_epoch",
              3,
          )
      ):
          return torch.profiler.profile(
              activities=[
                  torch.profiler.ProfilerActivity.CPU,
                  torch.profiler.ProfilerActivity.CUDA,
              ]
              if self._cfg.training.cuda > -1
              else [torch.profiler.ProfilerActivity.CPU],
              schedule=torch.profiler.schedule(
                  skip_first=getattr(
                      self._cfg.training.tensorboard.pytorch_profiler,
                      "skip_first",
                      10,
                  ),
                  wait=getattr(
                      self._cfg.training.tensorboard.pytorch_profiler,
                      "wait",
                      5,
                  ),
                  warmup=getattr(
                      self._cfg.training.tensorboard.pytorch_profiler,
                      "warmup",
                      3,
                  ),
                  active=getattr(
                      self._cfg.training.tensorboard.pytorch_profiler,
                      "active",
                      5,
                  ),
                  repeat=getattr(
                      self._cfg.training.tensorboard.pytorch_profiler,
                      "repeat",
                      0,
                  ),
              ),
              on_trace_ready=torch.profiler.tensorboard_trace_handler(
                  self._tracker._tensorboard_dir
              ),
              record_shapes=getattr(
                  self._cfg.training.tensorboard.pytorch_profiler,
                  "record_shapes",
                  True,
              ),
              profile_memory=getattr(
                  self._cfg.training.tensorboard.pytorch_profiler,
                  "profile_memory",
                  True,
              ),
              with_stack=getattr(
                  self._cfg.training.tensorboard.pytorch_profiler,
                  "with_stack",
                  True,
              ),
              with_flops=getattr(
                  self._cfg.training.tensorboard.pytorch_profiler,
                  "with_flops",
                  True,
              ),
          )
      else:
          return nullcontext(
              type("", (), {"step": lambda self: None})()
          )
  
imports: import os
  import copy
  import torch
  import hydra
  import time
  import logging
  from tqdm.auto import tqdm
  import wandb
  from torch_points3d.datasets.dataset_factory import instantiate_dataset
  from torch_points3d.models.model_factory import instantiate_model
  from torch_points3d.models.base_model import BaseModel
  from torch_points3d.datasets.base_dataset import BaseDataset
  from torch_points3d.metrics.base_tracker import BaseTracker
  from torch_points3d.metrics.colored_tqdm import Coloredtqdm
  from torch_points3d.metrics.model_checkpoint import ModelCheckpoint
  from torch_points3d.utils.colors import COLORS
  from torch_points3d.utils.wandb_utils import Wandb
  from torch_points3d.visualization import Visualizer
  import torch.profiler
  import torch.autograd.profiler
  from contextlib import nullcontext
label_desc: Use image node_id 20 for calling the Trainer obj's underlying member method code with example usage: obj.profiler_profile(epoch) and returns: torch, nullcontext