| 2407 | void TF_DeleteApiDefMap(TF_ApiDefMap* apimap) { delete apimap; } |
| 2408 | |
| 2409 | void TF_ApiDefMapPut(TF_ApiDefMap* api_def_map, const char* text, |
| 2410 | size_t text_len, TF_Status* status) { |
| 2411 | #if defined(IS_MOBILE_PLATFORM) || defined(IS_SLIM_BUILD) |
| 2412 | status->status = tensorflow::errors::Unimplemented( |
| 2413 | "ApiDefMap is not supported on mobile."); |
| 2414 | #else |
| 2415 | mutex_lock l(api_def_map->lock); |
| 2416 | if (api_def_map->update_docs_called) { |
| 2417 | status->status = FailedPrecondition( |
| 2418 | "TF_ApiDefMapPut cannot be called after TF_ApiDefMapGet has been " |
| 2419 | "called."); |
| 2420 | return; |
| 2421 | } |
| 2422 | string api_def_text(text, text_len); |
| 2423 | status->status = api_def_map->api_def_map.LoadApiDef(api_def_text); |
| 2424 | #endif // defined(IS_MOBILE_PLATFORM) || defined(IS_SLIM_BUILD) |
| 2425 | } |
| 2426 | |
| 2427 | TF_Buffer* TF_ApiDefMapGet(TF_ApiDefMap* api_def_map, const char* name, |
| 2428 | size_t name_len, TF_Status* status) { |