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

Function TF_ApiDefMapGet

tensorflow/c/c_api.cc:2427–2453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2425}
2426
2427TF_Buffer* TF_ApiDefMapGet(TF_ApiDefMap* api_def_map, const char* name,
2428 size_t name_len, TF_Status* status) {
2429#if defined(IS_MOBILE_PLATFORM) || defined(IS_SLIM_BUILD)
2430 status->status = tensorflow::errors::Unimplemented(
2431 "ApiDefMap is not supported on mobile.");
2432 return nullptr;
2433#else
2434 mutex_lock l(api_def_map->lock);
2435 if (!api_def_map->update_docs_called) {
2436 api_def_map->api_def_map.UpdateDocs();
2437 api_def_map->update_docs_called = true;
2438 }
2439 string name_str(name, name_len);
2440 const auto* api_def = api_def_map->api_def_map.GetApiDef(name_str);
2441 if (api_def == nullptr) {
2442 return nullptr;
2443 }
2444
2445 TF_Buffer* ret = TF_NewBuffer();
2446 status->status = MessageToBuffer(*api_def, ret);
2447 if (TF_GetCode(status) != TF_OK) {
2448 TF_DeleteBuffer(ret);
2449 return nullptr;
2450 }
2451 return ret;
2452#endif // defined(IS_MOBILE_PLATFORM) || defined(IS_SLIM_BUILD)
2453}
2454
2455TF_Buffer* TF_GetAllRegisteredKernels(TF_Status* status) {
2456 tensorflow::KernelList kernel_list = tensorflow::GetAllRegisteredKernels();

Callers 1

TESTFunction · 0.85

Calls 7

UnimplementedFunction · 0.85
TF_NewBufferFunction · 0.85
MessageToBufferFunction · 0.85
TF_GetCodeFunction · 0.85
TF_DeleteBufferFunction · 0.85
UpdateDocsMethod · 0.80
GetApiDefMethod · 0.80

Tested by 1

TESTFunction · 0.68