!46704 [MSLITE][Fix] support multi gears in alpha

Merge pull request !46704 from 赵英灼/fix_config_alpha
This commit is contained in:
i-robot 2022-12-13 02:11:03 +00:00 committed by Gitee
commit d1d125850a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 9 additions and 7 deletions

View File

@ -74,13 +74,15 @@ std::string CombineDynImgString(const struct mindspore::ProfileConfigs &profile)
first_dim = kIndex2;
second_dim = kIndex3;
}
int64_t min_first = profile.profiles[kIndex0].inputs[kIndex0].min_dims[first_dim];
int64_t max_first = profile.profiles[kIndex0].inputs[kIndex0].max_dims[first_dim];
int64_t min_second = profile.profiles[kIndex0].inputs[kIndex0].min_dims[second_dim];
int64_t max_second = profile.profiles[kIndex0].inputs[kIndex0].max_dims[second_dim];
for (int64_t i = min_first; i <= max_first; ++i) {
for (int64_t j = min_second; j <= max_second; ++j) {
ret += std::to_string(i) + "," + std::to_string(j) + ";";
for (size_t dim_idx = 0; dim_idx < profile.profiles.size(); ++dim_idx) {
int64_t min_first = profile.profiles[dim_idx].inputs[kIndex0].min_dims[first_dim];
int64_t max_first = profile.profiles[dim_idx].inputs[kIndex0].max_dims[first_dim];
int64_t min_second = profile.profiles[dim_idx].inputs[kIndex0].min_dims[second_dim];
int64_t max_second = profile.profiles[dim_idx].inputs[kIndex0].max_dims[second_dim];
for (int64_t i = min_first; i <= max_first; ++i) {
for (int64_t j = min_second; j <= max_second; ++j) {
ret += std::to_string(i) + "," + std::to_string(j) + ";";
}
}
}
ret = ret.substr(0, ret.size() - 1); // discard the final ";"