title: Use sub graph during main graph build in tensorflow
body: <p>I have a pre trained model in Keras that i wish to convert to Tensorflow. In this pre trained Keras net, some of the layers are actually defined as a sub model that takes as an input other layers from the main model in a few occasions (each occasion gets a different layer as an input) and produce the output by the same serial of internal layers actions.</p>
  
  <p>Is it possible to create such sub graph in Tensorflow that gets a tensor from the main graph and returns an output the same principle as Keras using the sub model?</p>
  
  <p>The sub graph that i have tried to implement, is built from <code>tf.placeholder</code> as the first layer defined according to the expected shape and dtype as its input tensors.</p>
  
  <p>One of the attempts that were failed is trying to connect between the main graph and the sub graph as following:</p>
  
  <pre><code>main_graph_out, = tf.import_graph_def(main_graph, 
                                           return_elements=[layer_name_as_input_to_sub_graph]])
  
  sub_graph_out, = tf.import_graph_def(submodel_graph, input_map={first_sub_graph_layer_name: main_graph_out},
                                           return_elements=[last_sub_graph_layer_name])
  </code></pre>
  
  <p>but this failed due to:
  <code>ValueError: Requested return tensor 'P3' not found in graph def</code></p>
  
  <p>(P3 is the name of the main graph layer that i wish to input the subgraph)</p>
  
  <p>would appreciate any kind of help...
  thanks a lot.</p>