diff options
author | Skye Wanderman-Milne <skyewm@google.com> | 2018-03-16 14:39:08 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-03-16 14:43:21 -0700 |
commit | af1c668e2db5bcfcd3b156800c4b982c9423e858 (patch) | |
tree | 1d784d76c84bfda2b890ba842a1fad905575c6c1 /tensorflow/c/c_api_internal.h | |
parent | 77c17f79399c4444ad49ac10f02e141c266c740e (diff) |
Downgrade run-after-mutation error to a log warning.
This is to ease the transition to the C API. Some tests currently mutate the
graph after running it but currently pass. This error was meant to guard
against existing behavior, so it's not a regression to make it a warning
instead for now.
PiperOrigin-RevId: 189395472
Diffstat (limited to 'tensorflow/c/c_api_internal.h')
-rw-r--r-- | tensorflow/c/c_api_internal.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/tensorflow/c/c_api_internal.h b/tensorflow/c/c_api_internal.h index e885a69927..95652a1137 100644 --- a/tensorflow/c/c_api_internal.h +++ b/tensorflow/c/c_api_internal.h @@ -84,19 +84,20 @@ struct TF_Graph { std::unordered_map<tensorflow::string, tensorflow::Node*> name_map GUARDED_BY(mu); - // The keys of this map are all the active sessions using this graph. - // Each value is the current "runnability" status of the corresponding - // session. Under normal conditions all statuses are Status::OK(), but - // if some operation is mutated after it was run by a session (this - // is detected in RecordMutation function), that session is no longer - // safe to run. Its status will contain the error that will be returned - // to the user, should she try running this session. + // The keys of this map are all the active sessions using this graph. Each + // value records whether the graph has been mutated since the corresponding + // session has been run (this is detected in RecordMutation function). If the + // string is empty, no mutation has occurred. Otherwise the string is a + // description of the mutation suitable for returning to the user. // // Sessions are added to this map in TF_NewSession, and removed in // TF_DeleteSession. // TF_Graph may only / must be deleted when // sessions.size() == 0 && delete_requested == true - tensorflow::gtl::FlatMap<TF_Session*, tensorflow::Status> sessions + // + // TODO(b/74949947): mutations currently trigger a warning instead of a bad + // status, this should be reverted when possible. + tensorflow::gtl::FlatMap<TF_Session*, tensorflow::string> sessions GUARDED_BY(mu); bool delete_requested GUARDED_BY(mu); // set true by TF_DeleteGraph |