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

Function TF_DequeueNamedTensor

tensorflow/c/c_api_experimental.cc:213–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211}
212
213TF_Tensor* TF_DequeueNamedTensor(TF_Session* session, int tensor_id,
214 TF_Status* status) {
215 assert(session);
216 {
217 tensorflow::mutex_lock c(session->graph->mu);
218 VLOG(1) << "Dequeuing named tensor with id " << tensor_id
219 << ", with input graph: "
220 << session->graph->graph.ToGraphDefDebug().DebugString();
221 }
222
223 TF_Operation* dequeue_op = TF_GraphOperationByName(
224 session->graph,
225 tensorflow::strings::StrCat("fifo_queue_dequeue_", tensor_id).c_str());
226 if (dequeue_op == nullptr) {
227 status->status = tensorflow::errors::Internal(
228 "Unable to find the dequeue node in the TF graph.");
229 return nullptr;
230 }
231
232 VLOG(1) << "Running the dequeue op";
233 TF_Output output{dequeue_op, 0};
234 TF_Tensor* ret;
235 TF_SessionRun(session, /*run_options*/ nullptr,
236 // input related parameters
237 /*inputs*/ nullptr, /*input_values*/ nullptr, /*ninputs*/ 0,
238 // output related parameters
239 /*outputs*/ &output, /*output_values*/ &ret,
240 /*noutputs*/ 1,
241 /*targets*/ nullptr, /*ntargets*/ 0,
242 /*run_metadata*/ nullptr, status);
243 if (VLOG_IS_ON(1) && status->status.ok()) {
244 tensorflow::Tensor tensor;
245 if (tensorflow::TF_TensorToTensor(ret, &tensor).ok()) {
246 VLOG(1) << "Dequeued tensor content: " << tensor.DebugString();
247 }
248 }
249 return ret;
250}
251
252void TF_EnqueueNamedTensor(TF_Session* session, int tensor_id,
253 TF_Tensor* tensor, TF_Status* status) {

Callers

nothing calls this directly

Calls 9

TF_GraphOperationByNameFunction · 0.85
InternalFunction · 0.85
TF_SessionRunFunction · 0.85
TF_TensorToTensorFunction · 0.85
ToGraphDefDebugMethod · 0.80
c_strMethod · 0.80
StrCatFunction · 0.50
DebugStringMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected