title: Tensorflor optimizer operation not found in get_operations
body: <p>When I define a class like so</p>
  
  <pre><code>class SimpleGraphCreator:
      """
      Some simple graph object...
      """
      def __init__(self):
          self.graph_obj = tf.Graph()
  
          with self.graph_obj.as_default() as g_def:
              x_input_fun = tf.placeholder(dtype=tf.float32, name='input')
              y_output_fun = tf.placeholder(dtype=tf.float32, name='output')
              w_weights_fun = tf.get_variable('weight_set', dtype=tf.float32, shape=(5,5))
              output = tf.matmul(x_input_fun, w_weights_fun, name='pred')
              loss = tf.subtract(output, y_output_fun, name='loss')
              self.opti = tf.train.AdamOptimizer(loss, name='opti')
              g_def.add_to_collection(tf.GraphKeys.TRAIN_OP, self.opti)
              # self.saver = tf.train.Saver()
  
          self.graph_obj = g_def
  </code></pre>
  
  <p>When I want to access the Optimizer node of this graph, I would like to do this using </p>
  
  <pre><code>some_graph = SimpleGraphCreater()
  some_graph.graph_obj.get_operation_by_name('opti')
  </code></pre>
  
  <p>However, this name cannot be found in the operations list... 
  (looking at <code>some_graph.graph_obj.get_operations()</code>)</p>
  
  <p>Only when I specially say in the graph that this optimizer should be added to the <code>tf.GraphKeys.TRAIN_OP</code> collection, am I able to get it back. Is there a more easy way?</p>
  
  <p>One constraint that I have though is that I can only pass graph objects... so no individual graph operations.</p>