class_docstr: Layer by layer profiling of PyTorch models, using the PyTorch profiler
  for memory profiling. Parts of the code are adapted from :obj:`torchprof`
  for layer-wise grouping.
  
  Args:
      model (torch.nn.Module): The underlying model to be profiled.
      enabled (bool, optional): If set to :obj:`True`, turn on the profiler.
          (default: :obj:`False`)
      use_cuda (bool, optional): Whether to profile CUDA execution.
          (default: :obj:`False`)
      profile_memory (bool, optional): If set to :obj:`True`, also profile
          memory usage. (default: :obj:`False`)
      paths ([str], optional): Pre-defined paths for fast loading.
          (default: :obj:`None`)
code: def __exit__(self, exc_type, exc_val, exc_tb):
      if not self.enabled:
          return
      tuple(map(self._remove_hook_trace, self.traces))
      del self._forwards  # remove unnecessary forwards
      self.exited = True
  
imports: import functools
  from collections import OrderedDict, defaultdict, namedtuple
  from typing import Any, List, NamedTuple, Optional, Tuple
  import torch
  import torch.profiler
label_desc: Use image node_id 3 for calling the Profiler obj's underlying member method code with example usage: obj.__exit__(exc_type, exc_val, exc_tb) without return types