Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions paddle/fluid/operators/conv_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ std::vector<int64_t> ConvOp::ComputeOutputShape(
ctx->Attrs().Get<std::string>("padding_algorithm");
int groups = ctx->Attrs().Get<int>("groups");
std::vector<int> dilations = ctx->Attrs().Get<std::vector<int>>("dilations");
int dilation_size = dilations.size();
for (int i = 0; i < dilation_size; ++i) {
PADDLE_ENFORCE_GT(
dilations[i], 0,
platform::errors::InvalidArgument(
"The dilation of Op(Conv) should be larget than 0, but received "
"dilation is %d.",
dilations[i]));
}
const std::string data_format = ctx->Attrs().Get<std::string>("data_format");

// MKL-DNN Kernels are using NCHW order of dims description
Expand Down
1 change: 1 addition & 0 deletions python/paddle/fluid/tests/unittests/test_conv1d_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ def add_error_cases(suite):
suite.addTest(
Conv1DErrorTestCase(
methodName='runTest', padding=[1, 2, 3, 4, 5]))
suite.addTest(Conv1DErrorTestCase(methodName='runTest', dilation=-10))


def load_tests(loader, standard_tests, pattern):
Expand Down