Bugfix: add input format check for dynamic batch

pull/462/head
wxl 4 years ago
parent 0fcf6fd664
commit 9af35ae1c1

@ -19,6 +19,7 @@
#include "framework/common/string_util.h"
#include "framework/common/types.h"
#include "framework/common/util.h"
#include "graph/utils/type_utils.h"
using std::pair;
using std::string;
@ -106,6 +107,10 @@ bool CheckDynamicBatchSizeInputShapeValid(unordered_map<string, vector<int64_t>>
bool CheckDynamicImagesizeInputShapeValid(unordered_map<string, vector<int64_t>> shape_map,
const std::string input_format, std::string &dynamic_image_size) {
if (!input_format.empty() && !ge::TypeUtils::IsFormatValid(input_format.c_str())) {
GELOGE(ge::PARAM_INVALID, "user input format [%s] is not found!", input_format.c_str());
return false;
}
int32_t size = 0;
for (auto iter = shape_map.begin(); iter != shape_map.end(); ++iter) {
vector<int64_t> shape = iter->second;

@ -1 +1 @@
Subproject commit 0f5ddb10ce79ea2c01b8b9cab5ec3102879610bb
Subproject commit 6995fa3682b9e1147c5173e56192126d2f91a2b7

@ -1 +1 @@
Subproject commit cf60b0c02d1a6e844fcec4202d18a069e9502b0f
Subproject commit 742f940d8868fbd2f5de19f726d6d28142bc0a6e
Loading…
Cancel
Save