We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4fa3b5 commit d71d51aCopy full SHA for d71d51a
torch/fx/experimental/symbolic_shapes.py
@@ -437,6 +437,8 @@ def integer_coefficient(x):
437
if x.is_Integer:
438
return abs(int(x))
439
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)
442
return abs(int(x.args[0])) if x.args[0].is_Integer else 1
443
else:
444
return 1
0 commit comments