-
Notifications
You must be signed in to change notification settings - Fork 181
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
Wrong output shape of torch.nn.Conv2d with 2d stride overload #496
Comments
I'm seeing the same thing. Thanks for the issue report. |
Yes, it's the encoding of padding='same' and padding='valid' that is incorrectly received in the C++ code. Same for Conv3d. The correct code should look like this: torch::nn::Conv2dOptions::padding_t padd =
(paddingX == -1) && (paddingY == 0) ? torch::kSame :
(paddingX == 0) && (paddingY == 0) ? torch::kValid :
(torch::nn::Conv2dOptions::padding_t)torch::ExpandingArray<2>({ paddingX, paddingY }); |
NiklasGustafsson
added a commit
to NiklasGustafsson/TorchSharp
that referenced
this issue
Jan 24, 2022
@241721 -- since you already looked into the details yourself, maybe you could do a quick review of PR #497? |
@241721 -- thanks for the PR review! |
Merged
Thx for your response, i approved. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
according to python's torch documentation (image below),
with W_in: 8, kernelSize: (1, 7), stride: (1, 1), padding: (0, 3) and default dilation (1,1) i should have recived W_out = 8.
I got 2 instead. That could be an issue I think.
There isn't that problem with H_out, when i set
W_in: 8, kernelSize: (7, 1), stride: (1, 1), padding: (3, 0)
Screen from
https://pytorch.org/docs/1.9.1/generated/torch.nn.Conv2d.html
The text was updated successfully, but these errors were encountered: