-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add dilation for exconv layer #5165
Conversation
paddle/function/ConvOpTest.h
Outdated
batchSize > 1 && stride > 1) | ||
break; | ||
if ((conv1 == "NaiveConv-CPU" || conv2 == "NaiveConv-CPU") && | ||
dilation > 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The NNPACKConv
also does not support dilation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -79,45 +79,54 @@ void Convolution(const std::string& conv1, | |||
if (outputChannels < inputChannels) continue; | |||
for (size_t stride : {1, 2}) { | |||
for (size_t padding : {0, 1}) { | |||
if (padding >= filterSize) break; | |||
for (size_t dilation : {1, 3}) { | |||
if (padding >= filterSize) break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why here do not need some checking like in the 'Im2ColTest.cpp?
filterSizemultiplied by
dilationmay be greater than
inputSize`.
size_t filterSizeH = (filterHeight - 1) * dilation + 1;
size_t filterSizeW = (filterWidth - 1) * dilation + 1;
if (inputHeight <= filterSizeH || inputWidth <= filterSizeW)
break;
if (padding >= filterSizeH || padding >= filterSizeW) break;
size_t outputHeight =
(inputHeight - filterSizeH + 2 * padding) / stride + 1;
size_t outputWidth =
(inputWidth - filterSizeW + 2 * padding) / stride + 1;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I add the control to it, the inputSize + 2 * padding < filterS
.
fix #5164
fix #5242