!8857 fix bug of change axis of reduce kernel when format is 6hd or fracz

From: @lianliguang
Reviewed-by: @kisnwang,@jjfeing
Signed-off-by: @jjfeing
This commit is contained in:
mindspore-ci-bot 2020-11-23 10:04:57 +08:00 committed by Gitee
commit 420a4dc162
2 changed files with 4 additions and 3 deletions

View File

@ -57,8 +57,9 @@ void ConvertReduceAttrFraczAnd6HD(const CNodePtr &cnode) {
std::vector<int64_t> convert_axis;
SafeCheckFunction(cnode, axis);
auto format = AnfAlgo::GetInputFormat(cnode, 0);
if (format != kOpFormat_FRAC_Z || format != kOpFormat_C1HWNCoC0) {
MS_LOG(EXCEPTION) << "The node [" << cnode->DebugString() << "] format " << format << " is not 5hd";
if (format != kOpFormat_FRAC_Z && format != kOpFormat_C1HWNCoC0) {
MS_LOG(EXCEPTION) << "The node [" << cnode->DebugString() << "] format " << format
<< " is not needed to change the axis";
}
for (auto elem : axis) {
switch (elem) {

View File

@ -327,7 +327,7 @@ void SetCastAndWeightFormat(const CNodePtr &kernel_node) {
auto next_op_name = AnfAlgo::GetNodeAttr<std::string>(kernel_node, kAttrPynativeNextOpName);
auto iter = kNextOpFormatList.find(next_op_name);
if (iter == kNextOpFormatList.end()) {
MS_LOG(WARNING) << "The op name " << next_op_name << "has been not setted in the next op map ";
MS_LOG(INFO) << "The op name " << next_op_name << "has been not setted in the next op map ";
return;
}
if (iter->second.size() < next_index) {