Clarification over Partial Run Feature of TensorFlow Graph

Hi All,

Let’s say I am building a graph representing the below equation.
p = x * y (x and y are integers and fed to the graph)
s = p + z(p is from above, z is a new input)
And I want to fetch both ‘p’ and ‘s’ from the graph session.

Now, I am trying to use the partial run feature of the graph where the results can be memoized internally in a session, my question is in the above equation if I keep changing only ‘z’, is the graph optimized to recompute only ‘s’ but not ‘p’ since the inputs to ‘p’ are not changing. Basically, does it evalute only the subgraph affected by the changed input and the rest stays as is.


Any update on this topic?

@Bhack @Divvya_Saxena Could you help with this?

Is your example similar to:

Also with TF 2.x you could organize your code around functions instead of handling TF 1 sessions: