Hey Merlin, I am glad you liked the article! Thanks for the feedback.
That’s a good catch. Even though we are not really using the `Graph` class for topologically sorting the nodes, it’s a very important building block in TensorFlow. And yes, you’re right, if we don’t add anything to the graph object, the code would still run.
In our implementation it’s solely a collection of nodes. My intention was to show that the Graph is really just that, more or less. This comes in handy if you work with multiple graphs or want to serialize the graph so that you can load it somewhere else. It’s also important when you want to visualize the graph. If you don’t have such container for your nodes, there’s no way you can distinguish between different graph instances.
In TensorFlow when you run a session, the graph is used to validate if a particular node is part of the graph used for the session that is being executed, and if a node is “fetchable” or “feedable” (in case a feed_dict is specified). Of course there’s a few more things, but they were not really important for understanding the basics.
I hope that clears things up a little bit.