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

Function GetFunctionNameAndAttr

tensorflow/compiler/tf2xla/graph_compiler.cc:203–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201namespace {
202
203Status GetFunctionNameAndAttr(const FunctionLibraryRuntime& flib,
204 const Node& node, NameAttrList* func) {
205 if (node.IsPartitionedCall()) {
206 const AttrValue* attr_value;
207 TF_RETURN_IF_ERROR(
208 node.attrs().Find(FunctionLibraryDefinition::kFuncAttr, &attr_value));
209 if (!attr_value->has_func()) {
210 return errors::InvalidArgument(
211 "The attribute value for attribute 'f' in node ", node.DebugString(),
212 " does not have 'func' field set");
213 }
214 *func = attr_value->func();
215 return Status::OK();
216 }
217
218 if (flib.GetFunctionLibraryDefinition()->Find(node.def().op())) {
219 func->set_name(node.type_string());
220 } else {
221 func->set_name(FunctionLibraryDefinition::kGradientOp);
222 }
223 *func->mutable_attr() = node.def().attr();
224 return Status::OK();
225}
226
227} // namespace
228

Callers 1

CompileFunctionalNodeMethod · 0.85

Calls 10

InvalidArgumentFunction · 0.85
IsPartitionedCallMethod · 0.80
attrMethod · 0.80
FindMethod · 0.45
attrsMethod · 0.45
DebugStringMethod · 0.45
funcMethod · 0.45
opMethod · 0.45
set_nameMethod · 0.45

Tested by

no test coverage detected