diff --git a/onnxscript/rewriter/pattern.py b/onnxscript/rewriter/pattern.py index d58cb7201..87544874d 100644 --- a/onnxscript/rewriter/pattern.py +++ b/onnxscript/rewriter/pattern.py @@ -559,11 +559,11 @@ def clone(self, node_map: dict[NodePattern, NodePattern], swap: bool) -> NodePat ), "Internal error: commutative swap applies only to binary ops." inputs = [inputs[1], inputs[0]] outputs = [value.name for value in self.outputs] - copy = NodePattern( + copied = NodePattern( self.domain, self.op, inputs, self.attributes, outputs, self.allow_other_attributes ) - node_map[self] = copy - return copy + node_map[self] = copied + return copied class NodeOutputPattern(ValuePattern):