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

Method LoadApiDef

tensorflow/core/framework/op_gen_lib.cc:503–517  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

501}
502
503Status ApiDefMap::LoadApiDef(const string& api_def_file_contents) {
504 const string contents = PBTxtFromMultiline(api_def_file_contents);
505 ApiDefs api_defs;
506 TF_RETURN_IF_ERROR(
507 proto_utils::ParseTextFormatFromString(contents, &api_defs));
508 for (const auto& api_def : api_defs.op()) {
509 // Check if the op definition is loaded. If op definition is not
510 // loaded, then we just skip this ApiDef.
511 if (map_.find(api_def.graph_op_name()) != map_.end()) {
512 // Overwrite current api def with data in api_def.
513 TF_RETURN_IF_ERROR(MergeApiDefs(&map_[api_def.graph_op_name()], api_def));
514 }
515 }
516 return Status::OK();
517}
518
519void ApiDefMap::UpdateDocs() {
520 for (auto& name_and_api_def : map_) {

Callers 4

GenerateTsOpFileTextFunction · 0.80
TESTFunction · 0.80
TF_ApiDefMapPutFunction · 0.80
TESTFunction · 0.80

Calls 6

PBTxtFromMultilineFunction · 0.85
MergeApiDefsFunction · 0.85
opMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by 3

GenerateTsOpFileTextFunction · 0.64
TESTFunction · 0.64
TESTFunction · 0.64