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

Method AddFunctionDefHelper

tensorflow/core/framework/function.cc:1115–1139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1113}
1114
1115Status FunctionLibraryDefinition::AddFunctionDefHelper(const FunctionDef& fdef,
1116 bool* added) {
1117 *added = false;
1118 std::shared_ptr<FunctionDefAndOpRegistration>& entry =
1119 function_defs_[fdef.signature().name()];
1120 if (entry) {
1121 if (!FunctionDefsEqual(entry->fdef, fdef)) {
1122 return errors::InvalidArgument(
1123 "Cannot add function '", fdef.signature().name(),
1124 "' because a different function with the same name already "
1125 "exists.");
1126 }
1127 // Ignore duplicate FunctionDefs.
1128 return Status::OK();
1129 }
1130 const OpDef* op_def;
1131 if (default_registry_->LookUpOpDef(fdef.signature().name(), &op_def).ok()) {
1132 return errors::InvalidArgument(
1133 "Cannot add function '", fdef.signature().name(),
1134 "' because an op with the same name already exists.");
1135 }
1136 entry = std::make_shared<FunctionDefAndOpRegistration>(fdef);
1137 *added = true;
1138 return Status::OK();
1139}
1140
1141Status FunctionLibraryDefinition::AddHelper(
1142 std::shared_ptr<FunctionDefAndOpRegistration> registration, bool* added) {

Callers

nothing calls this directly

Calls 6

FunctionDefsEqualFunction · 0.85
InvalidArgumentFunction · 0.85
signatureMethod · 0.80
LookUpOpDefMethod · 0.80
nameMethod · 0.65
okMethod · 0.45

Tested by

no test coverage detected