cybertronai / autograd-hacks

The Unlicense
151 stars 31 forks source link

A One-Line Bug That Could be Easily Fixed #5

Closed Haoxiang-Wang closed 4 years ago

Haoxiang-Wang commented 4 years ago

Hi, First, thanks a lot for this library!

Recently I found a bug in this line of your code: https://github.com/cybertronai/autograd-hacks/blob/2c2e494cbf7a0240199cd767f3179477f25f4e23/autograd_hacks.py#L165

The bug makes the code not compatible with non-default padding and stride in Conv2d. Hence, this should be corrected to A = torch.nn.functional.unfold(A, layer.kernel_size,padding=layer.padding,stride=layer.stride)

Best regards, Haoxiang

Haoxiang-Wang commented 4 years ago

I found this issue is already posted by another user. https://github.com/cybertronai/autograd-hacks/issues/3