fix debug of dynamic dims

pull/347/head
zhou_lili 5 years ago
parent 8c8dea2615
commit 5bff1b9652

@ -306,19 +306,21 @@ Status DeleteIdentityInsertByAdapter(ComputeGraphPtr &graph) {
} }
Status CheckNegativeCountOfOptions(const std::vector<std::vector<int64_t>> &shapes) { Status CheckNegativeCountOfOptions(const std::vector<std::vector<int64_t>> &shapes) {
size_t negative_count = 0; if (!GetLocalOmgContext().dynamic_dims.empty()) {
for (size_t i = 0; i < GetLocalOmgContext().user_input_dims.size(); ++i) { size_t negative_count = 0;
for (size_t j = 0; j < GetLocalOmgContext().user_input_dims.at(i).second.size(); ++j) { for (size_t i = 0; i < GetLocalOmgContext().user_input_dims.size(); ++i) {
if (GetLocalOmgContext().user_input_dims.at(i).second.at(j) == kDynmaicDims) { for (size_t j = 0; j < GetLocalOmgContext().user_input_dims.at(i).second.size(); ++j) {
negative_count++; if (GetLocalOmgContext().user_input_dims.at(i).second.at(j) == kDynmaicDims) {
negative_count++;
}
} }
} }
} for (size_t i = 0; i < shapes.size(); ++i) {
for (size_t i = 0; i < shapes.size(); ++i) { if (shapes.at(i).size() != negative_count) {
if (shapes.at(i).size() != negative_count) { GELOGE(PARAM_INVALID, "Each gear num of dynamic_dims is %zu should be equal to %zu.", shapes.at(i).size(),
GELOGE(PARAM_INVALID, "Each gear num of dynamic_dims is %zu should be equal to %zu.", shapes.at(i).size(), negative_count);
negative_count); return PARAM_INVALID;
return PARAM_INVALID; }
} }
} }
return SUCCESS; return SUCCESS;

Loading…
Cancel
Save