Skip to content

fix bug in merge_kernel for structural_reparam #59

Open
liyiersan wants to merge 3 commits intoDingXiaoH:mainfrom
liyiersan:fix-reparam-bug
Open

fix bug in merge_kernel for structural_reparam #59
liyiersan wants to merge 3 commits intoDingXiaoH:mainfrom
liyiersan:fix-reparam-bug

Conversation

@liyiersan
Copy link
Copy Markdown

When applying model.structural_reparam(), there is a need to add padding so that the output size can match, see #48.
Besides, I find that the kernel_size, stride, padding, and dilation may be tuples.

def get_conv2d(in_channels, out_channels, kernel_size, stride, padding, dilation, groups, bias):
      # other codes
      if has_large_impl and in_channels == out_channels and out_channels == groups and use_large_impl and stride == 1 and padding == kernel_size // 2 and dilation == 1:
      # kernel_size, stride, padding, and dilation may be tuples, the condition may be False!
      # other codes

Therefore, we need to convert the tuple to int to make DepthWiseConv2dImplicitGEMM work, or it would be replaced with nn.Conv2d.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant