Skip to content

Commit

Permalink
[inductor] Check if n is the input tensor of conv_pointwise (#125119)
Browse files Browse the repository at this point in the history
Fix #124837.
Check whether n is the input tensor of convolution_pointwise or qconv2d_pointwise, if so freeze the layout to channels_last.

Pull Request resolved: #125119
Approved by: https://github.com/leslie-fang-intel, https://github.com/jansel
  • Loading branch information
jiayisunx authored and pytorchmergebot committed May 8, 2024
1 parent d17be10 commit 82b7b59
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion torch/_inductor/graph.py
Expand Up @@ -1313,7 +1313,10 @@ def debug(msg):
ir.get_stride_order(n.meta["val"].stride()),
allow_padding=True,
)
if user.target in need_fixed_channels_last_layout:
if (
user.target in need_fixed_channels_last_layout
and n is user.args[0]
):
result = ir.ExternKernel.require_stride_order(
result,
ir.get_stride_order(
Expand Down

0 comments on commit 82b7b59

Please sign in to comment.