vanhuyz / CycleGAN-TensorFlow

An implementation of CycleGan using TensorFlow
MIT License
1.19k stars 436 forks source link

Control dependencies in CycleGAN optimizer #115

Open VladAndronik opened 4 years ago

VladAndronik commented 4 years ago

Thank you for your contribution, I learned much from it. But there is a thing that I can not come up with. There is a code in optimize method in model.py, where:

with tf.control_dependencies([G_optimizer, D_Y_optimizer, F_optimizer, D_X_optimizer]): return tf.no_op(name='optimizers')

What the control dependencies actually mean here? And why do we need tf.no_op? What the side-effect could arise if we drop it? Thanks in advance!