!2134 fix cododex & pclint with tbe kernel

Merge pull request !2134 from jjfeing/master
pull/2134/MERGE
mindspore-ci-bot 5 years ago committed by Gitee
commit 14b997448a

@ -74,14 +74,6 @@ TypeId DtypeToTypeId(const std::string &dtypes) {
return iter->second; return iter->second;
} }
std::string DtypeToString(const std::string &dtypes) {
auto iter = type_str_maps.find(dtypes);
if (iter == type_str_maps.end()) {
MS_LOG(EXCEPTION) << "Illegal input dtype: " << dtypes;
}
return iter->second;
}
std::string TypeIdToString(TypeId type_id) { std::string TypeIdToString(TypeId type_id) {
auto iter = type_id_str_maps.find(type_id); auto iter = type_id_str_maps.find(type_id);
if (iter == type_id_str_maps.end()) { if (iter == type_id_str_maps.end()) {

@ -28,8 +28,6 @@ namespace tbe {
constexpr auto kProcessorAiCore = "aicore"; constexpr auto kProcessorAiCore = "aicore";
TypeId DtypeToTypeId(const std::string &dtypes); TypeId DtypeToTypeId(const std::string &dtypes);
std::string DtypeToString(const std::string &dtypes);
std::string TypeIdToString(TypeId type_id); std::string TypeIdToString(TypeId type_id);
size_t GetDtypeNbyte(const std::string &dtypes); size_t GetDtypeNbyte(const std::string &dtypes);

@ -615,7 +615,7 @@ void TbeKernelBuild::GenDescJson(const std::shared_ptr<mindspore::AnfNode> &anf_
spec_shape.emplace_back(shape[2] * shape[3]); spec_shape.emplace_back(shape[2] * shape[3]);
spec_shape.emplace_back(shape[4]); spec_shape.emplace_back(shape[4]);
(*output_desc)["shape"] = spec_shape; (*output_desc)["shape"] = spec_shape;
} else if (fusion_data_type == kFusionReLUGradV2 && (*output_desc)["data_type"] == "uint8") { } else if (fusion_data_type == kFusionReLUGradV2) {
std::vector<size_t> spec_shape = {}; std::vector<size_t> spec_shape = {};
spec_shape.emplace_back(shape[0]); spec_shape.emplace_back(shape[0]);
spec_shape.emplace_back(shape[1]); spec_shape.emplace_back(shape[1]);

@ -51,7 +51,6 @@ class TbeKernelBroadCastSelecter {
std::vector<std::vector<size_t>> input_shapes_; std::vector<std::vector<size_t>> input_shapes_;
std::vector<std::vector<size_t>> output_shapes_; std::vector<std::vector<size_t>> output_shapes_;
}; };
} // namespace kernel } // namespace kernel
} // namespace mindspore } // namespace mindspore
#endif // MINDSPORE_TBE_KERNEL_BROADCAST_SELECTER_HELPER_H #endif // MINDSPORE_TBE_KERNEL_BROADCAST_SELECTER_HELPER_H

@ -175,6 +175,5 @@ void TbeKernelReduceSelecter::PadScalarShape(std::vector<size_t> *shape) const {
shape->emplace_back(1); shape->emplace_back(1);
} }
} }
} // namespace kernel } // namespace kernel
} // namespace mindspore } // namespace mindspore

@ -462,6 +462,9 @@ std::vector<std::string> TbeKernelSelect::SplitStrToVec(const std::string &op_se
std::vector<std::string> ret; std::vector<std::string> ret;
auto begin = op_select_tmp.find_first_not_of(space, 0); auto begin = op_select_tmp.find_first_not_of(space, 0);
auto sep_pos = op_select_tmp.find(sep); auto sep_pos = op_select_tmp.find(sep);
if (begin >= sep_pos) {
MS_LOG(EXCEPTION) << "Select ret json is error.";
}
while (sep_pos != std::string::npos) { while (sep_pos != std::string::npos) {
auto obj = op_select_tmp.substr(begin, sep_pos - begin); auto obj = op_select_tmp.substr(begin, sep_pos - begin);
if (kDynamicFormatMap.find(obj) != kDynamicFormatMap.end()) { if (kDynamicFormatMap.find(obj) != kDynamicFormatMap.end()) {
@ -628,6 +631,5 @@ void TbeKernelSelect::PrintSupportedFormat(const SupportFormat &support_format)
MS_LOG(INFO) << "Support format: " << print_str; MS_LOG(INFO) << "Support format: " << print_str;
} }
} }
} // namespace kernel } // namespace kernel
} // namespace mindspore } // namespace mindspore

Loading…
Cancel
Save