Browse Source

fix bug of change axis reduce

tags/v1.1.0
LianLiguang 5 years ago
parent
commit
29d585385e
2 changed files with 4 additions and 3 deletions
  1. +3
    -2
      mindspore/ccsrc/backend/optimizer/ascend/format_type/chang_axis_of_reduce_kernel.cc
  2. +1
    -1
      mindspore/ccsrc/runtime/device/ascend/kernel_select_ascend.cc

+ 3
- 2
mindspore/ccsrc/backend/optimizer/ascend/format_type/chang_axis_of_reduce_kernel.cc 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) {


+ 1
- 1
mindspore/ccsrc/runtime/device/ascend/kernel_select_ascend.cc 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) {


Loading…
Cancel
Save