@@ -2655,10 +2655,13 @@ void MaxPoolV2InferMeta(const MetaTensor& x,
26552655 false ,
26562656 common::errors::InvalidArgument (
26572657 " max_pool2d_v2 op does not support adaptive." ));
2658+ std::vector<int64_t > kernel_size_ (kernel_size.begin (), kernel_size.end ());
2659+ std::vector<int64_t > strides_ (strides.begin (), strides.end ());
2660+ std::vector<int64_t > paddings_ (paddings.begin (), paddings.end ());
26582661 Pool2DInferMeta (x,
2659- kernel_size ,
2660- strides ,
2661- paddings ,
2662+ kernel_size_ ,
2663+ strides_ ,
2664+ paddings_ ,
26622665 false ,
26632666 false ,
26642667 data_format,
@@ -3383,8 +3386,8 @@ void PNormInferMeta(const MetaTensor& x,
33833386
33843387void Pool2DInferMeta (const MetaTensor& x,
33853388 const IntArray& kernel_size,
3386- const std::vector<int >& strides,
3387- const std::vector<int >& paddings,
3389+ const std::vector<int64_t >& strides,
3390+ const std::vector<int64_t >& paddings,
33883391 bool ceil_mode,
33893392 bool exclusive,
33903393 const std::string& data_format,
@@ -3410,8 +3413,8 @@ void Pool2DInferMeta(const MetaTensor& x,
34103413 out->share_lod (x);
34113414 out->set_dtype (x.dtype ());
34123415 } else {
3413- std::vector<int > kernel_size_val (kernel_size.GetData ().begin (),
3414- kernel_size.GetData ().end ());
3416+ std::vector<int64_t > kernel_size_val (kernel_size.GetData ().begin (),
3417+ kernel_size.GetData ().end ());
34153418 PoolInferMeta (x,
34163419 kernel_size_val,
34173420 strides,
@@ -3468,9 +3471,9 @@ void SendV2InferMeta(const int peer, const int ring_id) {
34683471}
34693472
34703473void PoolInferMeta (const MetaTensor& x,
3471- const std::vector<int >& kernel_size,
3472- const std::vector<int >& strides,
3473- const std::vector<int >& paddings,
3474+ const std::vector<int64_t >& kernel_size,
3475+ const std::vector<int64_t >& strides,
3476+ const std::vector<int64_t >& paddings,
34743477 bool ceil_mode,
34753478 bool exclusive,
34763479 const std::string& data_format,
@@ -3480,8 +3483,8 @@ void PoolInferMeta(const MetaTensor& x,
34803483 const std::string& padding_algorithm,
34813484 MetaTensor* out,
34823485 MetaConfig config) {
3483- std::vector<int > paddings_ = paddings;
3484- std::vector<int > kernel_size_ = kernel_size;
3486+ std::vector<int64_t > paddings_ = paddings;
3487+ std::vector<int64_t > kernel_size_ = kernel_size;
34853488
34863489 auto x_dims = x.dims ();
34873490 PADDLE_ENFORCE_EQ (
@@ -3555,13 +3558,12 @@ void PoolInferMeta(const MetaTensor& x,
35553558 if ((!config.is_runtime ) && (data_dims[i] < 0 )) {
35563559 output_shape.push_back (data_dims[i]);
35573560 } else {
3558- output_shape.push_back (
3559- funcs::PoolOutputSize (static_cast <int >(data_dims[i]),
3560- kernel_size_[i],
3561- paddings_[2 * i],
3562- paddings_[2 * i + 1 ],
3563- strides[i],
3564- ceil_mode));
3561+ output_shape.push_back (funcs::PoolOutputSize (data_dims[i],
3562+ kernel_size_[i],
3563+ paddings_[2 * i],
3564+ paddings_[2 * i + 1 ],
3565+ strides[i],
3566+ ceil_mode));
35653567 }
35663568 }
35673569 }
0 commit comments