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

Details on Inv Depth Layer and ConstantPad2D #247

Open
F-Barto opened this issue Apr 27, 2023 · 0 comments
Open

Details on Inv Depth Layer and ConstantPad2D #247

F-Barto opened this issue Apr 27, 2023 · 0 comments

Comments

@F-Barto
Copy link

F-Barto commented Apr 27, 2023

Hello,

I would like to know why are you explicitly using ConstantPad2D ?

[link to code]

self.conv1 = nn.Conv2d(in_channels, out_channels, kernel_size=3, stride=1)
self.pad = nn.ConstantPad2d([1] * 4, value=0)

From the doc nn.Conv2d default padding_mode is to zeros. Isn't setting padding=1 in Conv2d equivalent to your self.conv1(self.pad(x)) ?

Am I missing something ?

Have a good day

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

No branches or pull requests

1 participant