code: def resize_graph(dot, size_per_element=0.15, min_size=12):
      """Resize the graph according to how much content it contains.
  
      Modify the graph in place.
      """
      # Get the approximate number of nodes and edges
      num_rows = len(dot.body)
      content_size = num_rows * size_per_element
      size = max(min_size, content_size)
      size_str = str(size) + "," + str(size)
      dot.graph_attr.update(size=size_str)
  
file_path: pytorchviz/torchviz/dot.py
imports: from collections import namedtuple
  from distutils.version import LooseVersion
  from graphviz import Digraph
  import torch
  from torch.autograd import Variable
  import warnings
label_desc: Use image node_id 4 for calling a global function with example usage: resize_graph(dot, size_per_element, min_size) without return types