title: What is different between tf.group and tensorflow collection?
body: <p>I'm new in tensorflow</p>
  
  <p>There are two ways we can run many tensor at once.
  use <code>collection</code> and <code>tf.gruop</code>
  but i'm not sure with two difference</p>
  
  <p>For simple example</p>
  
  <pre><code>const0=tf.constant(8)
  const1=tf.constant(11)
  
  tf.add_to_collection('my_collection' , const0)
  tf.add_to_collection('my_collection' , const1)
  
  #or 
  tf.group(const0 , const1)
  </code></pre>
  
  <p>The code below is <code>Mandelbrot fractal</code> implemented by tensorflow 
  There was no difference btw the one executed using <code>tf.group</code> and <code>collection</code></p>
  
  <pre><code>#step = tf.group(
  #  tf.assign(zs, zs_add),
  #  tf.assign_add(ns, zs_cast)
  #)
  
  #tf.add_to_collection('my_collection',tf.assign(zs, zs_add))
  #tf.add_to_collection('my_collection',(ns, zs_cast))
  #step = tf.get_collection('my_collection')
  #
  
  import tensorflow as tf
  import numpy as np 
  import matplotlib.pyplot as plt
  
  # Concept
  # input initial value
  #Y, X = np.mgrid[-1.3:1.3:0.005, -2:1:0.005]
  Y, X = np.mgrid[-1.3:1.3:0.005, -2:1:0.005]
  
  init_value = X + 1j*Y
  
  #
  xs = tf.constant(init_value )
  zs = tf.Variable(xs)
  zs_zeros = tf.zeros_like(xs, tf.float32)
  ns = tf.Variable(zs_zeros)
  
  zs_squre = tf.multiply(zs,zs)
  zs_add = tf.add(zs_squre , xs)
  zs_abs = tf.abs(zs_add)
  
  zs_less = tf.math.less(zs_abs , 4)
  zs_cast = tf.cast(zs_less , tf.float32)
  
  #
  step = tf.group(
    tf.assign(zs, zs_add),
    tf.assign_add(ns, zs_cast)
  )
  
  
  #
  sess = tf.Session()
  sess.run(tf.global_variables_initializer())
  
  for i in range(200):
      sess.run(step)
  value = sess.run(ns)
  plt.imshow(value)
  plt.show()
  </code></pre>
  
  <p>SO THIS IS MY QUESTION <br>
  what is difference with <code>tf.group</code> and <code>collection</code>?
  thank you!</p>