!26703 fix converter input shape

Merge pull request !26703 from yeyunpeng2020/converter
This commit is contained in:
i-robot 2021-11-24 02:33:11 +00:00 committed by Gitee
commit 354b7d44df
1 changed files with 2 additions and 2 deletions

View File

@ -183,14 +183,14 @@ int Flags::InitInTensorShape() {
auto string_split = lite::StrSplit(shape_str, std::string(":"));
CHECK_LESS_RETURN(string_split.size(), kMinShapeSizeInStr);
auto name = string_split[0];
for (size_t i = 0; i < string_split.size() - 1; ++i) {
for (size_t i = 1; i < string_split.size() - 1; ++i) {
name += ":" + string_split[i];
}
if (name.empty()) {
MS_LOG(ERROR) << "input tensor name is empty";
return lite::RET_ERROR;
}
auto dim_strs = string_split[1];
auto dim_strs = string_split[string_split.size() - 1];
if (dim_strs.empty()) {
MS_LOG(ERROR) << "input tensor dim string is empty";
return lite::RET_ERROR;