Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug in merge_kernel for structural_reparam #59

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

liyiersan
Copy link

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