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

Method AddHelper

tensorflow/core/framework/function.cc:1141–1167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1139}
1140
1141Status FunctionLibraryDefinition::AddHelper(
1142 std::shared_ptr<FunctionDefAndOpRegistration> registration, bool* added) {
1143 *added = false;
1144 std::shared_ptr<FunctionDefAndOpRegistration>& entry =
1145 function_defs_[registration->fdef.signature().name()];
1146 if (entry) {
1147 if (!FunctionDefsEqual(entry->fdef, registration->fdef)) {
1148 return errors::InvalidArgument(
1149 "Cannot add function '", registration->fdef.signature().name(),
1150 "' because a different function with the same name already "
1151 "exists.");
1152 }
1153 // Ignore duplicate FunctionDefs.
1154 return Status::OK();
1155 }
1156 const OpDef* op_def;
1157 if (default_registry_
1158 ->LookUpOpDef(registration->fdef.signature().name(), &op_def)
1159 .ok()) {
1160 return errors::InvalidArgument(
1161 "Cannot add function '", registration->fdef.signature().name(),
1162 "' because an op with the same name already exists.");
1163 }
1164 entry = std::move(registration);
1165 *added = true;
1166 return Status::OK();
1167}
1168
1169Status FunctionLibraryDefinition::CopyFunctionDefFrom(
1170 const string& func, const FunctionLibraryDefinition& other) {

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