docstr: Register memory profiling tools to IPython instance.
docstr_tok: ["Register","memory","profiling","tools","to","IPython","instance","."]
code: def start(self):
      """Register memory profiling tools to IPython instance."""
      self.running = True
      logger.debug("CellLogger: Starting")
  
      # self.exp does it when needed
      # preload_pytorch()
  
      # initial measurements
      if self.gc_collect:
          gc.collect()
      self.cpu_mem_used_prev = cpu_ram_used()
      if self.backend == "pytorch":
          self.gpu_mem_used_prev = self.gpu_ram_used()
      self.ipython.events.register("pre_run_cell", self.pre_run_cell)
      logger.debug(f"registered pre_run_cell: {self.pre_run_cell}")
      self.ipython.events.register("post_run_cell", self.post_run_cell)
      logger.debug(f"registered post_run_cell: {self.post_run_cell}")
  
      # run pre_run_cell() manually, since we are past that event in this cell
      self.pre_run_cell(None)
  
      return self
  
imports: from IPython import get_ipython
  from collections import namedtuple
  import datetime
  import gc
  import logging
  import os
  import psutil
  import random
  import sys
  import threading
  import time
label_desc: Use image node_id 7 for calling the CellLogger obj's underlying member method code with example usage: obj.start() and returns: self