Merge pull request #14762 from NHZlX/fix_bug_of_trt_pool

fix bug of trt pool2d converter
ce_debug
Zhaolong Xing 6 years ago committed by GitHub
commit bc6d0a3427
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -109,8 +109,12 @@ class Pool2dOpConverter : public OpConverter {
} }
if (pool_type == "max") { if (pool_type == "max") {
nvinfer1::DimsHW pre_pad(paddings[0], paddings[1]); // Under ceil mode, the pre_pad and post_pad are used to
nvinfer1::DimsHW post_pad(paddings[0], paddings[1]); // record the the padding size. In some ceil mode cases,
// we do not need padding, so we initialize the two vars to 0.
nvinfer1::DimsHW pre_pad(0, 0);
nvinfer1::DimsHW post_pad(0, 0);
if (ceil_mode) { if (ceil_mode) {
// If ceil mode is true, we will pad the appropriate size to the input. // If ceil mode is true, we will pad the appropriate size to the input.
DealCeilMode(input_shape, ksize, strides, paddings, &pre_pad, &post_pad, DealCeilMode(input_shape, ksize, strides, paddings, &pre_pad, &post_pad,

Loading…
Cancel
Save