title: What does the function control_dependencies do?
body: <p>I would like to have an example illustrating the use of the function <a href="https://www.tensorflow.org/api_docs/python/tf/control_dependencies" rel="noreferrer"><code>tf.control_dependencies</code></a>. For example, I want to create two tensors <code>X</code> and <code>Y</code> and if they are equal do or print something. </p>
  
  <pre><code>import tensorflow as tf
  
  session = tf.Session()
  
  X = tf.constant(5)
  Y = tf.constant(50)
  
  with tf.control_dependencies([tf.assert_equal(X, Y)]):
      print('X and Y are equal!')
  </code></pre>
  
  <p>In the code above, <code>X</code> is clearly not equal to <code>Y</code>. What is <code>tf.control_dependencies</code> doing in this case?</p>