title: Is it possible to replace placeholder with a constant in an existing graph?
body: <p>I have a frozen graph of a trained model, it has one <code>tf.placeholder</code> which I always feed the same value to. </p>
  
  <p>I was wondering if it's possible to replace it with <code>tf.constant</code> instead.
  If it is somehow - any examples would be appreciated!</p>
  
  <p><strong>EDIT: Here is how it looks with code, to help visualize the question</strong></p>
  
  <p>I am using a pre-trained (by other people) model to run inference. The model is stored locally as a frozen graph file with <code>.pb</code> extension.</p>
  
  <p>the code looks like this:</p>
  
  <pre><code># load graph
  graph = load_graph('frozen.pb')
  session = tf.Session(graph=graph)
  
  # Get input and output tensors
  images_placeholder = graph.get_tensor_by_name("input:0")
  output = graph.get_tensor_by_name("output:0")
  phase_train_placeholder = graph.get_tensor_by_name("phase_train:0")
  
  feed_dict = {images_placeholder: images, phase_train_placeholder: False}
  
  result = session.run(output, feed_dict=feed_dict)
  </code></pre>
  
  <p>The problem is that I always feed <code>phase_train_placeholder: False</code> for my purposes, so I was wondering if it's possible to eliminate that placeholder and replace it with something like <code>tf.constant(False, dtype=bool, shape=[])</code></p>