| @@ -63,6 +63,17 @@ vector<string> SplitInputShape(const std::string &input_shape) { | |||||
| } | } | ||||
| } // namespace | } // namespace | ||||
| Status CheckInputFormat(string &input_format) { | |||||
| if (input_format.empty()) { | |||||
| return ge::SUCCESS; | |||||
| } | |||||
| if (!ge::TypeUtils::IsFormatValid(input_format.c_str())) { | |||||
| GELOGE(ge::PARAM_INVALID, "user input format [%s] is not found!", input_format.c_str()); | |||||
| return ge::PARAM_INVALID; | |||||
| } | |||||
| return ge::SUCCESS; | |||||
| } | |||||
| bool CheckDynamicBatchSizeInputShapeValid(unordered_map<string, vector<int64_t>> shape_map, | bool CheckDynamicBatchSizeInputShapeValid(unordered_map<string, vector<int64_t>> shape_map, | ||||
| std::string &dynamic_batch_size) { | std::string &dynamic_batch_size) { | ||||
| int32_t size = 0; | int32_t size = 0; | ||||
| @@ -75,6 +75,7 @@ Status CheckInsertOpConfParamValid(const std::string insert_op_conf); | |||||
| Status CheckDisableReuseMemoryParamValid(const std::string disable_reuse_memory); | Status CheckDisableReuseMemoryParamValid(const std::string disable_reuse_memory); | ||||
| Status CheckEnableSingleStreamParamValid(const std::string enable_single_stream); | Status CheckEnableSingleStreamParamValid(const std::string enable_single_stream); | ||||
| Status CheckImplmodeParamValid(const std::string &optypelist_for_implmode, std::string &op_select_implmode); | Status CheckImplmodeParamValid(const std::string &optypelist_for_implmode, std::string &op_select_implmode); | ||||
| Status CheckInputFormat(string &input_format); | |||||
| void PrintOptionMap(std::map<std::string, std::string> &options, std::string tips); | void PrintOptionMap(std::map<std::string, std::string> &options, std::string tips); | ||||
| void EraseEndSemicolon(std::string ¶m); | void EraseEndSemicolon(std::string ¶m); | ||||
| } | } | ||||
| @@ -320,10 +320,7 @@ graphStatus Impl::CheckOptions(const std::map<std::string, std::string> &options | |||||
| } | } | ||||
| // Check Input Format | // Check Input Format | ||||
| if (options_.find(kInputFormat) != options_.end()) { | if (options_.find(kInputFormat) != options_.end()) { | ||||
| if (!options_[kInputFormat].empty() && !ge::TypeUtils::IsFormatValid(options_[kInputFormat].c_str())) { | |||||
| GELOGE(ge::PARAM_INVALID, "user input format [%s] is not found!", options_[kInputFormat].c_str()); | |||||
| return GRAPH_PARAM_INVALID; | |||||
| } | |||||
| return CheckInputFormat(options_[kInputFormat]); | |||||
| } | } | ||||
| return GRAPH_SUCCESS; | return GRAPH_SUCCESS; | ||||
| } | } | ||||