| 368 | } |
| 369 | |
| 370 | static void createTFEEnqueue(TFE_Context* ctx, TF_DataType inputType, |
| 371 | TFE_TensorHandle* queue, TFE_TensorHandle* tensor, |
| 372 | TF_Status* status) { |
| 373 | TFE_Op* op = TFE_NewOp(ctx, "QueueEnqueueV2", status); |
| 374 | if (!status->status.ok()) return; |
| 375 | std::unique_ptr<TFE_Op, decltype(&TFE_DeleteOp)> op_deleter(op, TFE_DeleteOp); |
| 376 | TFE_OpSetDevice(op, DEFAULT_CPU_DEVICE, status); |
| 377 | if (!status->status.ok()) return; |
| 378 | TFE_OpAddInput(op, queue, status); |
| 379 | if (!status->status.ok()) return; |
| 380 | TFE_OpAddInput(op, tensor, status); |
| 381 | if (!status->status.ok()) return; |
| 382 | TFE_OpSetAttrTypeList(op, "Tcomponents", &inputType, 1); |
| 383 | TFE_OpSetAttrInt(op, "timeout_ms", -1); |
| 384 | |
| 385 | int num_retvals = 0; |
| 386 | TFE_Execute(op, nullptr /*retvals*/, &num_retvals, status); |
| 387 | if (!status->status.ok()) return; |
| 388 | CHECK_EQ(num_retvals, 0); |
| 389 | } |
| 390 | |
| 391 | static TFE_TensorHandle* createTFEDequeue(TFE_Context* ctx, |
| 392 | TF_DataType inputType, |
no test coverage detected