| 201 | namespace { |
| 202 | |
| 203 | Status 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 |
no test coverage detected