diff options
author | 2016-10-25 06:48:35 -0800 | |
---|---|---|
committer | 2016-10-25 08:05:48 -0700 | |
commit | 40b1190d4b1a3192d0a8e0fcc5f5af3cbba81422 (patch) | |
tree | cb008f6f776e0f604ff2d62262edb8a285379c14 /tensorflow/core/debug | |
parent | 2826f62516e68f37d1fad06e02f2a914ddd3b10f (diff) |
tfdbg core: remove assumption about _SINK node from test
Change: 137156144
Diffstat (limited to 'tensorflow/core/debug')
-rw-r--r-- | tensorflow/core/debug/debug_gateway_test.cc | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/tensorflow/core/debug/debug_gateway_test.cc b/tensorflow/core/debug/debug_gateway_test.cc index bba8299e6d..d435553575 100644 --- a/tensorflow/core/debug/debug_gateway_test.cc +++ b/tensorflow/core/debug/debug_gateway_test.cc @@ -499,25 +499,22 @@ TEST_F(SessionDebugOutputSlotWithoutOngoingEdgeTest, Notification callbacks_done; - debug_gateway.SetNodeCompletionCallback( - [&mu, &callbacks_done](const string& node_name, const bool any_output) { - mutex_lock l(mu); - if (node_name == "_SINK" && !callbacks_done.HasBeenNotified()) { - callbacks_done.Notify(); - } - }); - std::vector<Tensor> debug_identity_tensor_vals; - debug_gateway.SetNodeValueCallback( - [this, &mu, &debug_identity_node_name, &debug_identity_tensor_vals]( - const string& node_name, const int output_slot, - const Tensor& tensor_value, const bool is_ref) { - mutex_lock l(mu); + debug_gateway.SetNodeValueCallback([this, &mu, &callbacks_done, + &debug_identity_node_name, + &debug_identity_tensor_vals]( + const string& node_name, const int output_slot, + const Tensor& tensor_value, const bool is_ref) { + mutex_lock l(mu); - if (node_name == debug_identity_node_name && output_slot == 0) { - debug_identity_tensor_vals.push_back(tensor_value); - } - }); + if (node_name == debug_identity_node_name && output_slot == 0) { + debug_identity_tensor_vals.push_back(tensor_value); + + if (!callbacks_done.HasBeenNotified()) { + callbacks_done.Notify(); + } + } + }); // Add DebugIdentity watch on c:0, which does not have an outgoing edge. RunOptions run_opts; |