code: def setUp(self):
      # Create an execution graph
      x = tf.compat.v1.placeholder(
          dtype=tf.float64, shape=[], name="input"
      )
      a = tf.Variable(111, name="var1", dtype=tf.float64)
      y = tf.math.multiply(x, a, name="output")
  
      self.ckpt_dir = "/tmp/ckpts/"
      self.saved_model_dir = "/tmp/saved_model/"
      self.frozen_graph_dir = "/tmp/frozen_graph/"
      self.tmp_dirs = [
          self.ckpt_dir,
          self.saved_model_dir,
          self.frozen_graph_dir,
      ]
      for d in self.tmp_dirs:
          if tf.io.gfile.exists(d):
              tf.io.gfile.rmtree(d)
              tf.io.gfile.makedirs(d)
  
      with tf.compat.v1.Session() as sess:
          tf.compat.v1.initialize_all_variables().run()
  
          # Save as checkpoint
          saver = tf.compat.v1.train.Saver()
          saver.save(
              sess, self.ckpt_dir + "model.ckpt", write_meta_graph=True
          )
  
          # Save as SavedModel
          tf.compat.v1.saved_model.simple_save(
              sess,
              self.saved_model_dir,
              inputs={"input": x},
              outputs={"output": y},
          )
  
          graph = sess.graph
          input_graph_def = graph.as_graph_def()
          output_node_names = ["output"]
          output_graph_def = graph_util.convert_variables_to_constants(
              sess, input_graph_def, output_node_names
          )
  
          # Save as binary graph
          tf.io.write_graph(
              output_graph_def,
              self.frozen_graph_dir,
              "graph.pb",
              as_text=False,
          )
  
          # Save as text graph
          tf.io.write_graph(
              output_graph_def,
              self.frozen_graph_dir,
              "graph.pbtxt",
              as_text=True,
          )
  
file_path: tcav/tcav/model_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow
  from tensorflow.python.framework import graph_util
  from tensorflow.python.platform import googletest
  from tcav.model import ModelWrapper
label_desc: Use image node_id 1 for calling the ModelTest obj's underlying member method code with example usage: obj.setUp() without return types