X Tutup
Skip to content

Cache graph functions and add If gradient test#637

Open
nfeybesse wants to merge 1 commit intotensorflow:masterfrom
nfeybesse:custom/graph-function-cache
Open

Cache graph functions and add If gradient test#637
nfeybesse wants to merge 1 commit intotensorflow:masterfrom
nfeybesse:custom/graph-function-cache

Conversation

@nfeybesse
Copy link
Contributor

This PR introduces a small cache of ConcreteFunction instances attached to a Graph.

When functions are attached via attachFunction, they are stored in a local cache
indexed by their defined name. This avoids repeatedly scanning the native
TensorFlow function library when resolving functions during gradient construction.

A helper method getFunctionCached(String prefix) is also added to allow quick lookup
of cached functions by name prefix.

In addition, this PR introduces IfGradientTest, a unit test validating correct
gradient propagation through a StatefulIf operation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

X Tutup