code: def AddShapesToGraphDef(session, out_node):
      """Add shapes attribute to nodes of the graph.
          Input graph here is the default graph in context.
  
      Parameters
      ----------
      session : tf.Session
          Tensorflow session
      out_node : String or List
          Final output node of the graph.
  
      Returns
      -------
      graph_def : Obj
          tensorflow graph definition with shapes attribute added to nodes.
  
      """
  
      graph_def = (
          tf_compat_v1.graph_util.convert_variables_to_constants(
              session,
              session.graph.as_graph_def(add_shapes=True),
              convert_to_list(out_node),
          )
      )
      return graph_def
  
imports: import re
  import os.path
  import collections
  import numpy
  import tensorflow
  from tensorflow.core.framework import graph_pb2
  import tvm
  from tvm.contrib.download import download_testdata
label_desc: Use image node_id 4 for calling a global function with example usage: AddShapesToGraphDef(session, out_node) and returns: graph_def