Skip to content

Commit 0fd0cae

Browse files
authored
When replacing literals with placeholders lists are always converted to (#2518)
tuples Summary: THis is needed because lists are not hashable, since they are mutable, and as a result we cannot have literals_to_ph in pattern rewrites used inside reference_representation_rewrite.py Test Plan: CI + next diff relies on this feature Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
1 parent 246b142 commit 0fd0cae

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

torchao/quantization/pt2e/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,6 +1031,8 @@ def replacement(x_i8, scale, zero_point, quant_min, quant_max):
10311031
continue
10321032
new_args = []
10331033
for arg in node.args:
1034+
if isinstance(arg, list):
1035+
arg = tuple(arg) # type: ignore[assignment]
10341036
if (
10351037
_is_literal(arg)
10361038
and arg not in exclude_literals

0 commit comments

Comments
 (0)