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

Function GetPotentialFunctionName

tensorflow/compiler/tf2xla/xla_compiler.cc:1088–1103  ·  view source on GitHub ↗

If node is PartitionedCall or StatefulPartitionedCall, returns the name from the "f" attr, else returns node.def().op(). Returned pointer points to the internal string either in node's attributes or in its NodeDef. This pointer is valid as long as the node has not been modified.

Source from the content-addressed store, hash-verified

1086// or in its NodeDef. This pointer is valid as long as the node has not been
1087// modified.
1088Status GetPotentialFunctionName(const Node& node, const string** name) {
1089 if (node.IsPartitionedCall()) {
1090 const AttrValue* attr_value;
1091 TF_RETURN_IF_ERROR(
1092 node.attrs().Find(FunctionLibraryDefinition::kFuncAttr, &attr_value));
1093 if (!attr_value->has_func()) {
1094 return errors::InvalidArgument(
1095 "The attribute value for attribute 'f' in node ", node.DebugString(),
1096 " does not have 'func' field set");
1097 }
1098 *name = &attr_value->func().name();
1099 return Status::OK();
1100 }
1101 *name = &node.type_string();
1102 return Status::OK();
1103}
1104
1105// Check that the graph doesn't have any invalid nodes (e.g. incompatible with
1106// given device_type, invalid data type, missing attributes...)

Callers 1

ValidateGraphFunction · 0.85

Calls 7

InvalidArgumentFunction · 0.85
IsPartitionedCallMethod · 0.80
nameMethod · 0.65
FindMethod · 0.45
attrsMethod · 0.45
DebugStringMethod · 0.45
funcMethod · 0.45

Tested by

no test coverage detected