Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions onnxscript/rewriter/_basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@
# We use a stack of partial matches to handle OR patterns that require backtracking.
self._partial_matches: list[PartialMatchResult] = [PartialMatchResult()]

def __repr__(self) -> str:
"""Returns a string representation of the match result."""
if not self._partial_matches:
return "MatchResult()"
return (

Check warning on line 45 in onnxscript/rewriter/_basics.py

View check run for this annotation

Codecov / codecov/patch

onnxscript/rewriter/_basics.py#L44-L45

Added lines #L44 - L45 were not covered by tests
f"MatchResult(success={bool(self)}, reason={self.reason!r}, nodes={self.nodes!r})"
)

@property
def _current_match(self) -> PartialMatchResult:
"""Returns the current match result."""
Expand Down
Loading