| 426 | // Returns true if every element of `sub` is contained in `super`. |
| 427 | template <class T> |
| 428 | bool IsSubsetOf(const T& sub, const T& super) { |
| 429 | for (const auto& o : sub) { |
| 430 | bool found = false; |
| 431 | for (const auto& n : super) { |
| 432 | if (o == n) { |
| 433 | found = true; |
| 434 | break; |
| 435 | } |
| 436 | } |
| 437 | if (!found) return false; |
| 438 | } |
| 439 | return true; |
| 440 | } |
| 441 | |
| 442 | bool MoreRestrictive(const OpDef::AttrDef& old_attr, |
| 443 | const OpDef::AttrDef& new_attr) { |