Skip to content

Commit 9419e30

Browse files
mcr229facebook-github-bot
authored andcommitted
Fix num nonbatch dims calculation (#10600)
Summary: Pull Request resolved: #10600 This will search for if there exists a conv in the graph, and then set the num nonbatch dims to 3. If we find a linear before conv, then the nonbatch dims should be 1. Again per the todo, we should parse the number of nonbatch dims from the affine quant node in the future. Reviewed By: derekxu Differential Revision: D73967842
1 parent 48ad9f6 commit 9419e30

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

backends/xnnpack/operators/quant_params.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ def _feeds_into_conv(node: torch.fx.Node) -> bool:
149149

150150
while users_list:
151151
current_user = users_list.pop()
152+
if "linear" in str(current_user.target):
153+
return False
152154
if "convolution" in str(current_user.target):
153155
return True
154156
users_list.extend(current_user.users)

0 commit comments

Comments
 (0)