From 93f911ac10ec982fe17f3f77fddd8672fdd5609f Mon Sep 17 00:00:00 2001 From: Haoyu Zhang <haoyuzhang@google.com> Date: Mon, 27 Jan 2020 11:02:05 -0800 Subject: [PATCH] Update outdated comments in eager executor. PiperOrigin-RevId: 291757617 Change-Id: Id7193d3818266e7622833ffa8fd7e1cc203e2879 --- tensorflow/core/common_runtime/eager/eager_executor.cc | 6 +++--- tensorflow/core/common_runtime/eager/eager_executor.h | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tensorflow/core/common_runtime/eager/eager_executor.cc b/tensorflow/core/common_runtime/eager/eager_executor.cc index 930f70b74e5..b2979bd9dee 100644 --- a/tensorflow/core/common_runtime/eager/eager_executor.cc +++ b/tensorflow/core/common_runtime/eager/eager_executor.cc @@ -127,7 +127,7 @@ Status EagerExecutor::AddOrExecute(std::unique_ptr<EagerNode> node) { // Inline execution in sync mode. if (!Async()) { // In sync mode, run the node item regardless of executor status. - return RunItem(std::move(item), false); + return RunItem(std::move(item), /*from_queue=*/false); } else { tensorflow::mutex_lock l(node_queue_mutex_); DVLOG(3) << "Add node [id " << item->id << "]" << item->node->DebugString() @@ -219,7 +219,7 @@ void EagerExecutor::NodeDone(const core::RefCountPtr<NodeItem>& item, bool need_notification = from_queue; if (from_queue) { - // Since this was from the async queue, pop it from the front of ht queue. + // Since this was from the async queue, pop it from the front of the queue DCHECK(!node_queue_.empty() && item.get() == node_queue_.front().get()); node_queue_.pop(); } else if (async) { @@ -316,7 +316,7 @@ void EagerExecutor::Run() { curr_item.reset(node_queue_.front().get()); curr_item->Ref(); } - Status status = RunItem(std::move(curr_item), true); + Status status = RunItem(std::move(curr_item), /*from_queue=*/true); if (!status.ok()) { VLOG(1) << "Failed to run item: " << status; } diff --git a/tensorflow/core/common_runtime/eager/eager_executor.h b/tensorflow/core/common_runtime/eager/eager_executor.h index 5bff05fe517..b9fd0122faf 100644 --- a/tensorflow/core/common_runtime/eager/eager_executor.h +++ b/tensorflow/core/common_runtime/eager/eager_executor.h @@ -171,8 +171,8 @@ class EagerExecutor { bool from_queue); void NotifyWaiters(uint64 id) EXCLUSIVE_LOCKS_REQUIRED(node_queue_mutex_); - // Starts execution of pending EagerNodes. This function loops till - // thread_done_ is set to true. If any errors are encontered, these are set + // Starts execution of pending EagerNodes. This function loops till executor + // state_ is set to kShutDown. If any errors are encontered, these are set // inside `status_`. The loop blocks anytime there are no pending nodes, or if // `status_` is not ok. void Run(); @@ -218,8 +218,8 @@ class EagerExecutor { // exits. Notification thread_exited_notification_; - // Indicates that `thread_` should stop as soon as it is done executing the - // current EagerNode. + // When state_ is set to kShutDown, it indicates that `thread_` should stop as + // soon as it is done executing the current EagerNode. ExecutorState state_ GUARDED_BY(node_queue_mutex_) = ExecutorState::kActive; // Thread object that calls the `Run` method in async mode.This thread runs