Google recently included in tensorflow's nightly builds its Eager mode, an imperative API to access tensorflow computation capabilities.

How do tensorflow eager compare to PyTorch?

Some aspects that could affect the comparison could be:

  • Advantages and disadvantages of eager due to its static graph legacy (e.g. names in nodes).
  • Intrinsic limitations of either of them that the other does not have.
  • Areas in which one of them needs improvement (e.g. feature completeness, computational optimizations).
  • Ecosystem differences (e.g. tensorboard?).

Note1: Yaroslav Bulatov wrote a review about eager's nice features.

Note2: In a previous question, I requested a comparison between PyTorch and Tensorflow Fold. At that time, it seemed to me that Fold could face PyTorch thanks to Google backing it. I was very very wrong: in the end, Google itself abandoned Fold in favour of Eager. I understand that this was due to intrinsic limitations in the normal tensorflow API that led Fold not to be very friendly, which constrained its adoption.

  • 2
    For me, the biggest difference is that Pytorch code base is much easier to read and understand. If I have any specific question regarding the implementation it's easy to dive right in. I have absolutely no idea what Tensorflow is doing under the hood. – Louis T Nov 8 '17 at 7:42

One the key advantages that is I use a lot is that is compatible with pdb, so that

pdb.set_trace # To the rescue

Permits the use of python data structures

and let us to use pythonic control flow instead of using the main tf equivalents.

Also it allows to avoid metaprogramming issues such as "lazy loading" and adding a bunch of operations to my graph. Also autograd similarities

  • Are you referring to pytorch or tf eager? It seems to me that your statements apply to both of them... – ncasas Feb 19 at 8:21

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.