| 466 | extern "C" { |
| 467 | |
| 468 | void TF_Run(TF_DeprecatedSession* s, const TF_Buffer* run_options, |
| 469 | // Input tensors |
| 470 | const char** c_input_names, TF_Tensor** c_inputs, int ninputs, |
| 471 | // Output tensors |
| 472 | const char** c_output_names, TF_Tensor** c_outputs, int noutputs, |
| 473 | // Target nodes |
| 474 | const char** c_target_oper_names, int ntargets, |
| 475 | TF_Buffer* run_metadata, TF_Status* status) { |
| 476 | TF_Run_Setup(noutputs, c_outputs, status); |
| 477 | std::vector<std::pair<string, Tensor>> input_pairs(ninputs); |
| 478 | if (!TF_Run_Inputs(c_inputs, &input_pairs, status)) return; |
| 479 | for (int i = 0; i < ninputs; ++i) { |
| 480 | input_pairs[i].first = c_input_names[i]; |
| 481 | } |
| 482 | std::vector<string> output_names(noutputs); |
| 483 | for (int i = 0; i < noutputs; ++i) { |
| 484 | output_names[i] = c_output_names[i]; |
| 485 | } |
| 486 | std::vector<string> target_oper_names(ntargets); |
| 487 | for (int i = 0; i < ntargets; ++i) { |
| 488 | target_oper_names[i] = c_target_oper_names[i]; |
| 489 | } |
| 490 | TF_Run_Helper(s->session, nullptr, run_options, input_pairs, output_names, |
| 491 | c_outputs, target_oper_names, run_metadata, status); |
| 492 | } |
| 493 | |
| 494 | void TF_PRunSetup(TF_DeprecatedSession* s, |
| 495 | // Input names |