Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Liyulingyue committed Feb 6, 2023
1 parent 0f5001c commit 871d5ae
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions paddle/phi/infermeta/binary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -456,16 +456,24 @@ void ConvInferMeta(const MetaTensor& input,
auto filter_dims = filter.dims();
int dilation_size = dilations.size();
for (int i = 0; i < dilation_size; ++i) {
PADDLE_ENFORCE_GT(
PADDLE_ENFORCE_NE(
in_dims[i],
0,
phi::errors::InvalidArgument(
"The size of Op(Conv) inputs should not be 0.");
}
const bool channel_last = (config.is_run_mkldnn_kernel == false) &&
(data_format == "NHWC" || data_format == "NDHWC");

for (int i = 0; i < 2; ++i) {
PADDLE_ENFORCE_NE(
dilations[i],
0,
phi::errors::InvalidArgument(
"The dilation of Op(Conv) should be larget than 0, but received "
"dilation is %d.",
dilations[i]));
}
const bool channel_last = (config.is_run_mkldnn_kernel == false) &&
(data_format == "NHWC" || data_format == "NDHWC");

PADDLE_ENFORCE_EQ(
in_dims.size() == 4 || in_dims.size() == 5,
Expand Down

0 comments on commit 871d5ae

Please sign in to comment.