docs: def show_tree(self, cachelim=np.inf):
          """Cachelim is in Mb. For any cached jacobians above cachelim, they are also added to the graph. """
          import tempfile
          import subprocess
  
          assert DEBUG, "Please use dr tree visualization functions in debug mode"
  
          def string_for(self, my_name):
              if hasattr(self, 'label'):
                  my_name = self.label
              my_name = '%s (%s)' % (my_name, str(self.__class__.__name__))
              result = []
              if not hasattr(self, 'dterms'):
                  return result
              for dterm in self.dterms:
                  if hasattr(self, dterm):
                      dtval = getattr(self, dterm)
                      if hasattr(dtval, 'dterms') or hasattr(dtval, 'terms'):
                          child_label = getattr(dtval, 'label') if hasattr(dtval, 'label') else dterm
                          child_label = '%s (%s)' % (child_label, str(dtval.__class__.__name__))
                          src = 'aaa%d' % (id(self))
                          dst = 'aaa%d' % (id(dtval))
                          result += ['%s -> %s;' % (src, dst)]
                          result += ['%s [label="%s"];' % (src, my_name)]
                          result += ['%s [label="%s"];' % (dst, child_label)]
                          result += string_for(getattr(self, dterm), dterm)
  
              if cachelim != np.inf and hasattr(self, '_cache') and 'drs' in self._cache:
                  from six.moves import cPickle as pickle
                  for dtval, jac in list(self._cache['drs'].items()):
                      # child_label = getattr(dtval, 'label') if hasattr(dtval, 'label') else dterm
                      # child_label = '%s (%s)' % (child_label, str(dtval.__class__.__name__))
                      src = 'aaa%d' % (id(self))
                      dst = 'aaa%d' % (id(dtval))
                      try:                    
                          sz = sys.getsizeof(pickle.dumps(jac, -1))
                      except: # some are functions
                          sz = 0
                      # colorattr = "#%02x%02x%02x" % (szpct*255, 0, (1-szpct)*255)
                      # print colorattr
                      if sz > (cachelim * 1024 * 1024):
                          result += ['%s -> %s [style=dotted,color="<<<%d>>>"];' % (src, dst, sz)]
                      #
                      # result += ['%s -> %s [style=dotted];' % (src, dst)]
                      # result += ['%s [label="%s"];' % (src, my_name)]
                      # result += ['%s [label="%s"];' % (dst, child_label)]
                      # result += string_for(getattr(self, dterm), dterm)
                      
              return result
  
          dot_file_contents = 'digraph G {\n%s\n}' % '\n'.join(list(set(string_for(self, 'root'))))
          if cachelim != np.inf:
              import re
              strs = re.findall(r'<<<(\d+)>>>', dot_file_contents, re.DOTALL)
              if len(strs) > 0:
                  the_max = np.max(np.array([int(d) for d in strs]))
                  for s in strs:
                      szpct = float(s)/the_max
                      sz = float(s)
                      unit = 'b'
                      if sz > 1024.: 
                          sz /= 1024
                          unit = 'K'
                      if sz > 1024.: 
                          sz /= 1024
                          unit = 'M'
                      if sz > 1024.: 
                          sz /= 1024
                          unit = 'G'
                      if sz > 1024.: 
                          sz /= 1024
                          unit = 'T'
                          
                      dot_file_contents = re.sub('<<<%s>>>' % s, '#%02x%02x%02x",label="%d%s' % (szpct*255, 0, (1-szpct)*255, sz, unit), dot_file_contents)
  
          dot_file = tempfile.NamedTemporaryFile()
          dot_file.write(dot_file_contents)
          dot_file.flush()
          png_file = tempfile.NamedTemporaryFile(suffix='.png', delete=False)
          subprocess.call(['dot', '-Tpng', '-o', png_file.name, dot_file.name])
          import webbrowser
          webbrowser.open('file://' + png_file.name)