I'm trying to do a line-by-line profiling of my code and wanted to see if TensorFlow can do line by line profiling or per function profiling while profiling the underlying code that built these functions.
However is it possible to look at line by line runtimes and look at the source code runtime for one particular function?
For example, when running an SVM implementation I got on Github:
Columns: Line # , Hits, Time, Per Hit, % Time, Line Contents
I used lprun from kernprof's Github to run the profiling. As you can see, the sess.run() function takes up 94% of the time, and I would like to know how I can use TensorFlow or other tools to look at a finer grained breakdown of the code under sess.run to see why it is taking 94% of the time. Sure, one can use the time per hit, since I am iterating for 1000 epochs, to get a "finer grade" breakdown of the percentage, but it doesn't give insight into more information about the source code.
If the text in the code is too small I attached a .txt file for easier visibility.
Any feedback would be very helpful. Thanks!
Edit: I figured it out. You can call the LineProfiler instance of kernprof's implementation multiple times using the Line Profiler example in the following link: https://zapier.com/engineering/profiling-python-boss/. You can specify which functions to look into by typing out the name of that function in the follow argument.