class_docstr: A context decorator to facilitate timing a function, *e.g.*, obtaining
  the runtime of a specific model on a specific dataset.
  
  .. code-block:: python
  
      @torch.no_grad()
      def test(model, x, edge_index):
          return model(x, edge_index)
  
      with timeit() as t:
          z = test(model, x, edge_index)
      time = t.duration
  
  Args:
      log (bool, optional): If set to :obj:`False`, will not log any runtime
          to the console. (default: :obj:`True`)
      avg_time_divisor (int, optional): If set to a value greater than
          :obj:`1`, will divide the total time by this value. Useful for
          calculating the average of runtimes within a for-loop.
          (default: :obj:`0`)
code: def __exit__(self, *args):
      if torch.cuda.is_available():
          torch.cuda.synchronize()
      self.t_end = time.time()
      self.duration = self.t_end - self.t_start
      if self.avg_time_divisor > 1:
          self.duration = self.duration / self.avg_time_divisor
      if self.log:  # pragma: no cover
          print(f"Time: {self.duration:.8f}s", flush=True)
  
imports: import os
  import pathlib
  import time
  from contextlib import ContextDecorator, contextmanager
  from dataclasses import dataclass
  from typing import Any, List, Tuple, Union
  import torch
  from torch.autograd.profiler import EventList
  from torch.profiler import ProfilerActivity, profile
  from torch_geometric.profile.utils import byte_to_megabyte, get_gpu_memory_from_ipex, get_gpu_memory_from_nvidia_smi
label_desc: Use image node_id 3 for calling the timeit obj's underlying member method code with example usage: obj.__exit__() without return types