From 2a8dc5dd27886dedd94bd2e9adb68e8581e299e0 Mon Sep 17 00:00:00 2001 From: liuwenhao4 Date: Mon, 9 Nov 2020 17:45:59 +0800 Subject: [PATCH] fix infoshape problems of pooling ops --- mindspore/lite/src/ops/pooling.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mindspore/lite/src/ops/pooling.cc b/mindspore/lite/src/ops/pooling.cc index 3b415339c6..b8cfc4fd46 100644 --- a/mindspore/lite/src/ops/pooling.cc +++ b/mindspore/lite/src/ops/pooling.cc @@ -229,8 +229,8 @@ int Pooling::InferShape(std::vector inputs_, std::vector out } } auto input_shape = input->shape(); - input_shape.at(1) = output_h; - input_shape.at(2) = output_w; + input_shape.at(1) = output_h > 0 ? output_h : 1; + input_shape.at(2) = output_w > 0 ? output_w : 1; output->set_shape(input_shape); return RET_OK; }