MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Take

Method Take

tensorflow/core/kernels/work_queue_ops.cc:106–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104 }
105
106 Status Take(Tensor* output) {
107 std::unique_lock<std::mutex> lock(mu_);
108
109 take_cv_.wait(lock, [this]() { return !queue_.empty() || is_closed_; });
110
111 if (TF_PREDICT_FALSE(queue_.empty() && is_closed_)) {
112 return Status(errors::OutOfRange(
113 strings::StrCat("All works in work queue ", name_, " are taken.")));
114 }
115
116 output->scalar<string>().setConstant(std::move(queue_.front()));
117 queue_.pop_front();
118
119 return Status::OK();
120 }
121
122 Status GetSize(Tensor* size) {
123 std::unique_lock<std::mutex> lock(mu_);

Callers 2

ComputeAsyncMethod · 0.45

Calls 6

StatusClass · 0.70
StrCatFunction · 0.50
waitMethod · 0.45
emptyMethod · 0.45
frontMethod · 0.45
pop_frontMethod · 0.45

Tested by

no test coverage detected