| 302 | } |
| 303 | |
| 304 | bool MayCallFunction(const Node& n, const FunctionLibraryDefinition* flib_def) { |
| 305 | if (flib_def->Contains(n.type_string())) { |
| 306 | return true; |
| 307 | } |
| 308 | |
| 309 | // This is a conservative check: there may be nodes with a `func` |
| 310 | // attribute that do not make function calls. |
| 311 | return absl::c_any_of(n.def().attr(), |
| 312 | [](const std::pair<string, AttrValue>& name_attr_pair) { |
| 313 | return name_attr_pair.second.has_func(); |
| 314 | }); |
| 315 | } |
| 316 | bool IsShapeConsumerOp(const Node& node) { |
| 317 | return node.type_string() == "Shape" || node.type_string() == "Rank" || |
| 318 | node.type_string() == "Size"; |
no test coverage detected