From 5faf76b789f2f5d3efcca5797087df6f2c0ac707 Mon Sep 17 00:00:00 2001 From: zyfncg Date: Fri, 29 Apr 2022 14:56:37 +0800 Subject: [PATCH] fix bug of building InferMetaContext (#42211) --- paddle/fluid/framework/infershape_utils.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/paddle/fluid/framework/infershape_utils.cc b/paddle/fluid/framework/infershape_utils.cc index 8a64d4e1926..2a8ffbf431e 100644 --- a/paddle/fluid/framework/infershape_utils.cc +++ b/paddle/fluid/framework/infershape_utils.cc @@ -558,10 +558,7 @@ CompatInferMetaContext BuildInferMetaContext(InferShapeContext* ctx, } if (num_ele <= 0) { - PADDLE_THROW(platform::errors::Unimplemented( - "Invalid number for construct phi::IntArray, expected " - "number > 0, but actually is %d. ", - num_ele)); + num_ele = tensor_dims.size(); } } else { -- GitLab