class_docstr: Code line CuPy memory profiler.
  
  This profiler shows line-by-line GPU memory consumption using traceback
  module. But, note that it can trace only CPython level, no Cython level.
  ref. https://github.com/cython/cython/issues/1755
  
  Example:
      Code example::
  
          from cupy.cuda import memory_hooks
          hook = memory_hooks.LineProfileHook()
          with hook:
              # some CuPy codes
          hook.print_report()
  
      Output example::
  
          _root (4.00KB, 4.00KB)
            lib/python3.6/unittest/__main__.py:18:<module> (4.00KB, 4.00KB)
              lib/python3.6/unittest/main.py:255:runTests (4.00KB, 4.00KB)
                tests/cupy_tests/test.py:37:test (1.00KB, 1.00KB)
                tests/cupy_tests/test.py:38:test (1.00KB, 1.00KB)
                tests/cupy_tests/test.py:39:test (2.00KB, 2.00KB)
  
      Each line shows::
  
          {filename}:{lineno}:{func_name} ({used_bytes}, {acquired_bytes})
  
      where *used_bytes* is the memory bytes used from CuPy memory pool, and
      *acquired_bytes* is the actual memory bytes the CuPy memory pool
      acquired from GPU device.
      *_root* is a root node of the stack trace to show total memory usage.
  
  Args:
      max_depth (int): maximum depth to follow stack traces.
          Default is 0 (no limit).
class_docstr_tok: ["Code","line","CuPy","memory","profiler",".","This","profiler","shows","line-by-line","GPU","memory","consumption","using","traceback","module",".","But",",","note","that","it","can","trace","only","CPython","level",",","no","Cython","level",".","ref",".","https",":","\/\/github.com\/cython\/cython\/issues\/1755","Example",":","Code","example",":",":","from","cupy.cuda","import","memory_hooks","hook","=","memory_hooks.LineProfileHook","(",")","with","hook",":","#","some","CuPy","codes","hook.print_report","(",")","Output","example",":",":","_root","(","4.00KB",",","4.00KB",")","lib\/python3.6\/unittest\/__main__.py:18",":","<","module",">","(","4.00KB",",","4.00KB",")","lib\/python3.6\/unittest\/main.py:255",":","runTests","(","4.00KB",",","4.00KB",")","tests\/cupy_tests\/test.py:37",":","test","(","1.00KB",",","1.00KB",")","tests\/cupy_tests\/test.py:38",":","test","(","1.00KB",",","1.00KB",")","tests\/cupy_tests\/test.py:39",":","test","(","2.00KB",",","2.00KB",")","Each","line","shows",":",":","{","filename","}",":","{","lineno","}",":","{","func_name","}","(","{","used_bytes","}",",","{","acquired_bytes","}",")","where","*","used_bytes","*","is","the","memory","bytes","used","from","CuPy","memory","pool",",","and","*","acquired_bytes","*","is","the","actual","memory","bytes","the","CuPy","memory","pool","acquired","from","GPU","device",".","*","_root","*","is","a","root","node","of","the","stack","trace","to","show","total","memory","usage",".","Args",":","max_depth","(","int",")",":","maximum","depth","to","follow","stack","traces",".","Default","is","0","(","no","limit",")","."]
code: def _add_frame(self, parent, stackframe):
      key = self._key_frame(parent, stackframe)
      if key in self._memory_frames:
          memory_frame = self._memory_frames[key]
      else:
          memory_frame = MemoryFrame(parent, stackframe)
          self._memory_frames[key] = memory_frame
      return memory_frame
  
imports: from os import path
  import sys
  import traceback
  from cupy.cuda import memory_hook
label_desc: Use image node_id 7 for calling the LineProfileHook obj's underlying member method code with example usage: obj._add_frame(parent, stackframe) and returns: memory_frame