| 239 | } |
| 240 | |
| 241 | void RecordMutation(TF_Graph* graph, const TF_Operation& op, |
| 242 | const char* mutation_type) { |
| 243 | // If any session has already run this node_id, mark this session as |
| 244 | // unrunnable. |
| 245 | for (auto it : graph->sessions) { |
| 246 | mutex_lock session_lock(it.first->mu); |
| 247 | if (it.first->last_num_graph_nodes > op.node.id()) { |
| 248 | it.second = strings::StrCat( |
| 249 | "Operation '", op.node.DebugString(), "' was changed by ", |
| 250 | mutation_type, |
| 251 | " after it was run by a session. This mutation will have no effect, " |
| 252 | "and will trigger an error in the future. Either don't modify " |
| 253 | "nodes after running them or create a new session."); |
| 254 | } |
| 255 | } |
| 256 | } |
| 257 | |
| 258 | namespace { |
| 259 |
no test coverage detected