| 132 | } |
| 133 | |
| 134 | bool HasParametrizedBody(const FunctionDef& func) { |
| 135 | const auto is_parametrized = [&](const NodeDef& node) { |
| 136 | for (const auto& attr : node.attr()) { |
| 137 | if (!attr.second.placeholder().empty()) return true; |
| 138 | } |
| 139 | return false; |
| 140 | }; |
| 141 | return std::any_of(func.node_def().begin(), func.node_def().end(), |
| 142 | is_parametrized); |
| 143 | } |
| 144 | |
| 145 | bool IsParametrized(const FunctionDef& func) { |
| 146 | return HasParametrizedType(func) || HasParametrizedBody(func); |