title: How to make a histogram of tensor columns in tensorflow
body: <p>I have a batch of images as a tensor of size <code>[batch_size, w, h]</code>. </p>
  
  <p>I wish to get a histogram of the values in each column.</p>
  
  <p>This is what I came up with (but it works only for the first image in the batch and its also very slow): </p>
  
  <pre><code>global_hist = []
  net = tf.squeeze(net)
  for i in range(batch_size):
      for j in range(1024):
          hist = tf.histogram_fixed_width(tf.slice(net,[i,0,j],[1,1024,1]), [0.0, 0.2, 0.4, 0.6, 0.8, 1.0], nbins=10)
          global_hist[i].append(hist)
  </code></pre>
  
  <p>Is there an efficient way to do this? </p>