Browse Source

Bugfix:add check for invaild input format

pull/459/head
wxl 4 years ago
parent
commit
c2750d9869
4 changed files with 9 additions and 4 deletions
  1. +6
    -1
      ge/ir_build/atc_ir_common.cc
  2. +1
    -1
      ge/ir_build/atc_ir_common.h
  3. +1
    -1
      metadef
  4. +1
    -1
      parser

+ 6
- 1
ge/ir_build/atc_ir_common.cc View File

@@ -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;
@@ -105,7 +106,11 @@ 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) {
std::string &input_format, std::string &dynamic_image_size) {
if (!input_format.empty() && !ge::TypeUtils::IsFormatValid(input_format)) {
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
ge/ir_build/atc_ir_common.h View File

@@ -53,7 +53,7 @@ bool CheckDynamicBatchSizeInputShapeValid(unordered_map<string, vector<int64_t>>
std::string &dynamic_batch_size);

bool CheckDynamicImagesizeInputShapeValid(unordered_map<string, vector<int64_t>> shape_map,
const std::string input_format, std::string &dynamic_image_size);
std::string &input_format, std::string &dynamic_image_size);

bool CheckDynamicDimsInputShapeValid(const std::unordered_map<std::string, std::vector<int64_t>> &shape_map,
std::string input_format, std::string &dynamic_dims);


+ 1
- 1
metadef

@@ -1 +1 @@
Subproject commit 0f5ddb10ce79ea2c01b8b9cab5ec3102879610bb
Subproject commit 6d1a199a4a23e33ce8f6d6478f3dfe0b0f693015

+ 1
- 1
parser

@@ -1 +1 @@
Subproject commit cf60b0c02d1a6e844fcec4202d18a069e9502b0f
Subproject commit 742f940d8868fbd2f5de19f726d6d28142bc0a6e

Loading…
Cancel
Save