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

Function TF_SessionPRunSetup

tensorflow/c/c_api.cc:2299–2333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2297}
2298
2299void TF_SessionPRunSetup(TF_Session* session, const TF_Output* inputs,
2300 int ninputs, const TF_Output* outputs, int noutputs,
2301 const TF_Operation* const* target_opers, int ntargets,
2302 const char** handle, TF_Status* status) {
2303 *handle = nullptr;
2304
2305 if (session->extend_before_run &&
2306 !ExtendSessionGraphHelper(session, status)) {
2307 return;
2308 }
2309
2310 std::vector<string> input_names(ninputs);
2311 for (int i = 0; i < ninputs; ++i) {
2312 input_names[i] = OutputName(inputs[i]);
2313 }
2314
2315 std::vector<string> output_names(noutputs);
2316 for (int i = 0; i < noutputs; ++i) {
2317 output_names[i] = OutputName(outputs[i]);
2318 }
2319
2320 std::vector<string> target_names(ntargets);
2321 for (int i = 0; i < ntargets; ++i) {
2322 target_names[i] = target_opers[i]->node.name();
2323 }
2324
2325 string new_handle;
2326 status->status = session->session->PRunSetup(input_names, output_names,
2327 target_names, &new_handle);
2328 if (TF_GetCode(status) == TF_OK) {
2329 char* buf = new char[new_handle.size() + 1];
2330 memcpy(buf, new_handle.c_str(), new_handle.size() + 1);
2331 *handle = buf;
2332 }
2333}
2334
2335void TF_DeletePRunHandle(const char* handle) {
2336 delete[] handle;

Callers 2

TESTFunction · 0.85

Calls 6

ExtendSessionGraphHelperFunction · 0.85
TF_GetCodeFunction · 0.85
c_strMethod · 0.80
nameMethod · 0.65
PRunSetupMethod · 0.45
sizeMethod · 0.45

Tested by 1

TESTFunction · 0.68