| 492 | } |
| 493 | |
| 494 | void TF_PRunSetup(TF_DeprecatedSession* s, |
| 495 | // Input names |
| 496 | const char** c_input_names, int ninputs, |
| 497 | // Output names |
| 498 | const char** c_output_names, int noutputs, |
| 499 | // Target nodes |
| 500 | const char** c_target_oper_names, int ntargets, |
| 501 | const char** handle, TF_Status* status) { |
| 502 | *handle = nullptr; |
| 503 | |
| 504 | std::vector<string> input_names(ninputs); |
| 505 | std::vector<string> output_names(noutputs); |
| 506 | std::vector<string> target_oper_names(ntargets); |
| 507 | for (int i = 0; i < ninputs; ++i) { |
| 508 | input_names[i] = c_input_names[i]; |
| 509 | } |
| 510 | for (int i = 0; i < noutputs; ++i) { |
| 511 | output_names[i] = c_output_names[i]; |
| 512 | } |
| 513 | for (int i = 0; i < ntargets; ++i) { |
| 514 | target_oper_names[i] = c_target_oper_names[i]; |
| 515 | } |
| 516 | string new_handle; |
| 517 | status->status = s->session->PRunSetup(input_names, output_names, |
| 518 | target_oper_names, &new_handle); |
| 519 | if (TF_GetCode(status) == TF_OK) { |
| 520 | char* buf = new char[new_handle.size() + 1]; |
| 521 | memcpy(buf, new_handle.c_str(), new_handle.size() + 1); |
| 522 | *handle = buf; |
| 523 | } |
| 524 | } |
| 525 | |
| 526 | void TF_PRun(TF_DeprecatedSession* s, const char* handle, |
| 527 | // Input tensors |
no test coverage detected