!29268 fix global max pooling

Merge pull request !29268 from zhaodezan/master
This commit is contained in:
i-robot 2022-01-19 03:02:51 +00:00 committed by Gitee
commit 83631c112e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 1 additions and 1 deletions

View File

@ -72,7 +72,7 @@ int PoolingInferShape(const TensorC *const *inputs, size_t inputs_size, TensorC
}
int output_h = 0;
int output_w = 0;
if (param->stride_h_ == 0 || param->stride_w_ == 0) {
if ((param->stride_h_ == 0 || param->stride_w_ == 0) && !param->global_) {
return NNACL_PARAM_INVALID;
}
if (param->pad_mode_ == Pad_same) {