code: def dump_model(
      path, graph=None, sess=None, ckpt_file=None, bigdl_type="float"
  ):
      """
      Dump a tensorflow model to files. The graph will be dumped to path/model.pb, and the checkpoint
      will be dumped to path/model.bin
  
      :param path: dump folder path
      :param sess: if user pass in session, we assume that the variable of the graph in the session
      has been inited
      :param graph: tensorflow graph. Default use the default graph of the session
      :param bigdl_type: model variable numeric type
      :return: nothing
      """
      if not os.path.isdir(path):
          invalidInputError(False, "Folder " + path + " does not exist")
  
      temp = None
      if ckpt_file is None:
          if sess is None:
              sess = tf.Session()
              init = tf.global_variables_initializer()
              sess.run(init)
              temp = tempfile.mkdtemp()
              ckpt_file = temp
          # dump checkpoint to temp files
          saver = tf.train.Saver()
          saver.save(sess, ckpt_file)
  
      # generate bin files
      tensors = export_checkpoint(ckpt_file)
      save_variable_bigdl(tensors, path + "/model.bin", bigdl_type)
  
      # dump grap to pb file
      graph = sess.graph if graph is None else graph
      with gfile.GFile(path + "/model.pb", "wb") as f:
          f.write(graph.as_graph_def().SerializeToString())
      if temp is not None:
          try:
              shutil.rmtree(temp)
          except OSError as e:
              if e.errno != errno.ENOENT:
                  invalidOperationError(False, str(e), cause=e)
  
file_path: BigDL/python/dllib/src/bigdl/dllib/utils/tf_utils.py
imports: import tempfile
  import tensorflow
  import shutil
  from google.protobuf import text_format
  from tensorflow.core.framework import graph_pb2
  from tensorflow.python.client import session
  from tensorflow.python.framework import graph_util
  from tensorflow.python.framework import importer
  from tensorflow.python.platform import gfile
  from bigdl.dllib.nn.layer import Model
  from bigdl.dllib.utils.common import JTensor
  from bigdl.dllib.utils.common import callBigDlFunc
  from bigdl.dllib.utils.log4Error import *
  import os
label_desc: Use image node_id 5 for calling a global function with example usage: dump_model(path, graph, sess, ckpt_file, bigdl_type) without return types