| 78 | namespace { |
| 79 | |
| 80 | const tensorflow::OpDef* GetOpDef(TFE_Op* op, TF_Status* status) { |
| 81 | if (op->inference_ctx) { |
| 82 | return op->inference_ctx->op_def; |
| 83 | } |
| 84 | const tensorflow::OpDef* op_def; |
| 85 | status->status = |
| 86 | tensorflow::OpDefForOp(op->operation.Name().c_str(), &op_def); |
| 87 | return op_def; |
| 88 | } |
| 89 | |
| 90 | bool IsCPU(const tensorflow::Device* d) { |
| 91 | return d == nullptr || d->tensorflow_gpu_device_info() == nullptr; |
no test coverage detected