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.
| 1086 | // or in its NodeDef. This pointer is valid as long as the node has not been |
| 1087 | // modified. |
| 1088 | Status 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...) |
no test coverage detected