Thanks a lot, @Sean_Moriarity for the detailed reply. My mistake about the rank. Although I have two questions.


As I understand tf.function uses Graphs (operations+tensors) for function’s computations. Now If I don’t use tf.function, how is the graph generated. And if it is not generated, how does the code run faster because internally graphs optimize by pipelining parallel operations together. (This is my understanding. I may be wrong). Do tf.scan and tf.while_loop also create Graphs.


The code is running fine by removing decorators i.e. eagerly. How can I run the code non-eagerly or using graphs?