Skip to content

Commit d71d51a

Browse files
committed
Update
[ghstack-poisoned]
1 parent f4fa3b5 commit d71d51a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

torch/fx/experimental/symbolic_shapes.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,8 @@ def integer_coefficient(x):
437437
if x.is_Integer:
438438
return abs(int(x))
439439
elif x.is_Mul:
440+
# If one of the args of a Mul is an Integer, it is the
441+
# first arg. eg: args(2*x*3*y) == (6, x, y)
440442
return abs(int(x.args[0])) if x.args[0].is_Integer else 1
441443
else:
442444
return 1

0 commit comments

Comments
 (0)