Fix the constant folding bug of shape

This commit is contained in:
yeyunpeng2020 2021-07-06 09:10:45 +08:00
parent 871f6f0a88
commit 498479ed5e
1 changed files with 2 additions and 1 deletions

View File

@ -59,7 +59,8 @@ std::vector<Tensor *> GetCNodeInputTensors(const CNodePtr &cnode, lite::converte
for (size_t i = 1; i < cnode->size(); ++i) {
int status = 0;
lite::DataInfo data_info;
if (CheckPrimitiveType(cnode, prim::kPrimShape)) {
if (lite::ConverterContext::GetInstance()->GetGraphInputTensorShapeMapSize() > 0 &&
CheckPrimitiveType(cnode, prim::kPrimShape)) {
if (utils::isa<abstract::AbstractTensorPtr>(cnode->input(i)->abstract())) {
auto abstract_tensor = utils::cast<abstract::AbstractTensorPtr>(cnode->input(i)->abstract());
if (abstract_tensor == nullptr) {