import tensorflow as tf

            # Update variables
            grads_and_vars = list(zip(gradients, variables))
            with tf.control_dependencies([collect_op]):
                train_op = opt.apply_gradients(grads_and_vars, global_step)
