Returns true and captures the layout iff it matches the pattern.
| 469 | |
| 470 | // Returns true and captures the layout iff it matches the pattern. |
| 471 | bool Match(const ::xla::Layout* layout, MatchOption option) const { |
| 472 | if (impl_.Match(layout, option)) { |
| 473 | if (option.capture && matched_layout_) { |
| 474 | *matched_layout_ = layout; |
| 475 | } |
| 476 | return true; |
| 477 | } |
| 478 | return false; |
| 479 | } |
| 480 | |
| 481 | // Returns true and captures the layout iff it matches the pattern. |
| 482 | bool Match(::xla::Layout* layout, MatchOption option) const { |