此函数指定某些操作执行的依赖关系

返回一个控制依赖的上下文管理器,使用 with 关键字可以让在这个上下文环境中的操作都在 control_inputs 执行

with tf.control_dependencies([a, b]):
    c = ....
    d = ...

在执行完 a,b 操作之后,才能执行 c,d 操作。意思就是 c,d 操作依赖 a,b 操作

 with tf.control_dependencies([train_step, variable_averages_op]):
     train_op = tf.no_op(name='train')

tf.no_op()表示执行完 train_step, variable_averages_op 操作之后什么都不做。