title: Tensorflow: Replace one op with another(maybe even 2 ops)
body: <p>My goal is to build a script to change an operation into another one using TF's graph editor. So far I tried making a script that just changes the input kernel weights of a Conv2D, but to no avail, as the interface is pretty confusing.</p>
  
  <pre><code>with tf.Session() as sess:
  
      model_filename = sys.argv[1]
  
      with gfile.FastGFile(model_filename, 'r') as f:
  
          graph_def = graph_pb2.GraphDef()
          text_format.Merge(f.read(), graph_def)
          importer.import_graph_def(graph_def)
  
          #my_sgv = ge.sgv("Conv2D", graph=tf.get_default_graph())
          #print my_sgv
  
          convs = find_conv2d_ops(tf.get_default_graph())
          print convs
  
          my_sgv = ge.sgv(convs)
          print my_sgv
  
          conv_tensor = tf.get_default_graph().get_tensor_by_name(convs[0].name + ':0')
          conv_weights_input = tf.get_default_graph().get_tensor_by_name(convs[0].inputs[1].name)
  
          weights_new = tf.Variable(tf.truncated_normal([1, 1, 1, 8], stddev=0.03),
                                    name='Wnew')
  
          ge.graph_replace(conv_tensor, {conv_weights_input: weights_new})
  </code></pre>
  
  <p>The error is "input needs to be a Tensor: ". Can someone please provide some insights?</p>