From efb99eaa4598505a81e366d8fe4c2d0d4b3567d0 Mon Sep 17 00:00:00 2001 From: Ganesan Ramalingam Date: Fri, 2 Aug 2024 07:50:25 -0700 Subject: [PATCH] Fix lint warnings --- onnxscript/rewriter/pattern.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/onnxscript/rewriter/pattern.py b/onnxscript/rewriter/pattern.py index 32f01f337..d58cb7201 100644 --- a/onnxscript/rewriter/pattern.py +++ b/onnxscript/rewriter/pattern.py @@ -379,10 +379,10 @@ def extend(self, other: MatchResult | bool): @contextlib.contextmanager -def pattern_builder(rewriter_context: RewriterContext): +def pattern_builder(builder: OpsetPatternBuilder): global _pattern_builder prev_builder = _pattern_builder - _pattern_builder = rewriter_context + _pattern_builder = builder yield _pattern_builder = prev_builder @@ -552,7 +552,7 @@ def matches(self, node: ir.Node, match: MatchResult) -> MatchResult: return match def clone(self, node_map: dict[NodePattern, NodePattern], swap: bool) -> NodePattern: - inputs = [v.clone(node_map) for v in self.inputs] + inputs = [(v.clone(node_map) if v is not None else None) for v in self.inputs] if swap: assert ( len(inputs) == 2