Skip to content

Commit

Permalink
Address code scanner warning
Browse files Browse the repository at this point in the history
  • Loading branch information
gramalingam committed Jan 9, 2025
1 parent 4572eb0 commit 6ae71ea
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions onnxscript/rewriter/pattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def clone(self, node_map: dict[NodePattern, NodePattern]) -> ValuePattern:
def name(self) -> str | None:
return self._name

def producer(self) -> None | NodePattern:
def producer(self) -> NodePattern | None:
return None

def uses(self) -> Sequence[tuple[NodePattern, int]]:
Expand Down Expand Up @@ -970,6 +970,7 @@ def __str__(self) -> str:
class SimplePatternMatcher(PatternMatcher):
def __init__(self, pattern: GraphPattern) -> None:
super().__init__(pattern)
self._current_node: ir.Node | None = None

def fail(self, reason: str, node: ir.Node | None = None) -> bool:
if self._verbose:
Expand Down Expand Up @@ -1128,7 +1129,7 @@ def _init_match(self, verbose: int) -> None:
self._verbose = verbose
self._matched: dict[NodePattern, ir.Node] = {}
self._match: MatchResult = MatchResult()
self._current_node: ir.Node | None = None
self._current_node = None

def _get_output_values(self) -> list[ir.Value] | None:
"""Get values bound to the output variables of the pattern."""
Expand Down

0 comments on commit 6ae71ea

Please sign in to comment.