title: How to put tf.layers variables in tf.name_scope/tf.variable_scope?
body: <p>I have a problem with Tensorflow:</p>
  <p>The following code produces a correct(ish) graph for a convolutional block:</p>
  <pre><code>def conv_layer(self, inputs, filter_size = 3, num_filters = 256, name = None):
      scope_name = name
      if name == None:
          scope_name = &quot;conv_layer&quot;
  
      with tf.name_scope(scope_name):
          conv = tf.contrib.layers.conv2d(inputs, num_filters, filter_size, activation_fn = None)
          batch_norm = tf.contrib.layers.batch_norm(conv)
          act = tf.nn.leaky_relu(batch_norm)
  
          return act
  </code></pre>
  <p>The problem is that the <code>tf.layers</code> API makes some ugly variables that do not actually stay within the <code>name_scope</code>. Here is the Tensorboard view so you can see what I mean.</p>
  <p><img src="https://i.imgur.com/T9rnmpD.png" alt="Tensorboard" /></p>
  <p>Is there anyway to get those variables to go into the scope? This is a big problem when it comes to visualizing the graph because I plan this network to much larger. (As you can see to the right, this is already a big problem, I have to remove those from the main graph manually every time I boot up Tensorboard.)</p>