affinelayer / pix2pix-tensorflow

Tensorflow port of Image-to-Image Translation with Conditional Adversarial Nets https://phillipi.github.io/pix2pix/
MIT License
5.07k stars 1.3k forks source link

Purpose of tf.identity #29

Open himat opened 7 years ago

himat commented 7 years ago

Why is tf.identity necessary in some cases in your code, such as here https://github.com/affinelayer/pix2pix-tensorflow/blob/master/pix2pix.py#L119

Cristy94 commented 7 years ago

Well, as explained in the comment above it I assume it is so that the Graph is correctly generated (you can try commenting that line and use Tensorboard to see if the Graph changes).

himat commented 7 years ago

Can you explain why the graph would change though? Shouldn't an identity not have aany effect?