Update outdated comments in eager executor.

PiperOrigin-RevId: 291757617
Change-Id: Id7193d3818266e7622833ffa8fd7e1cc203e2879
This commit is contained in:
Haoyu Zhang 2020-01-27 11:02:05 -08:00 committed by TensorFlower Gardener
parent 334b068913
commit 93f911ac10
2 changed files with 7 additions and 7 deletions
tensorflow/core/common_runtime/eager

View File

@ -127,7 +127,7 @@ Status EagerExecutor::AddOrExecute(std::unique_ptr<EagerNode> node) {
// Inline execution in sync mode. // Inline execution in sync mode.
if (!Async()) { if (!Async()) {
// In sync mode, run the node item regardless of executor status. // 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 { } else {
tensorflow::mutex_lock l(node_queue_mutex_); tensorflow::mutex_lock l(node_queue_mutex_);
DVLOG(3) << "Add node [id " << item->id << "]" << item->node->DebugString() 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; bool need_notification = from_queue;
if (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()); DCHECK(!node_queue_.empty() && item.get() == node_queue_.front().get());
node_queue_.pop(); node_queue_.pop();
} else if (async) { } else if (async) {
@ -316,7 +316,7 @@ void EagerExecutor::Run() {
curr_item.reset(node_queue_.front().get()); curr_item.reset(node_queue_.front().get());
curr_item->Ref(); curr_item->Ref();
} }
Status status = RunItem(std::move(curr_item), true); Status status = RunItem(std::move(curr_item), /*from_queue=*/true);
if (!status.ok()) { if (!status.ok()) {
VLOG(1) << "Failed to run item: " << status; VLOG(1) << "Failed to run item: " << status;
} }

View File

@ -171,8 +171,8 @@ class EagerExecutor {
bool from_queue); bool from_queue);
void NotifyWaiters(uint64 id) EXCLUSIVE_LOCKS_REQUIRED(node_queue_mutex_); void NotifyWaiters(uint64 id) EXCLUSIVE_LOCKS_REQUIRED(node_queue_mutex_);
// Starts execution of pending EagerNodes. This function loops till // Starts execution of pending EagerNodes. This function loops till executor
// thread_done_ is set to true. If any errors are encontered, these are set // 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 // inside `status_`. The loop blocks anytime there are no pending nodes, or if
// `status_` is not ok. // `status_` is not ok.
void Run(); void Run();
@ -218,8 +218,8 @@ class EagerExecutor {
// exits. // exits.
Notification thread_exited_notification_; Notification thread_exited_notification_;
// Indicates that `thread_` should stop as soon as it is done executing the // When state_ is set to kShutDown, it indicates that `thread_` should stop as
// current EagerNode. // soon as it is done executing the current EagerNode.
ExecutorState state_ GUARDED_BY(node_queue_mutex_) = ExecutorState::kActive; ExecutorState state_ GUARDED_BY(node_queue_mutex_) = ExecutorState::kActive;
// Thread object that calls the `Run` method in async mode.This thread runs // Thread object that calls the `Run` method in async mode.This thread runs