Browse Source

!10719 Fix a bug when axises are not in order

From: @yuan_shen_zhou
Reviewed-by: @liangchenghui,@wuxuejian
Signed-off-by: @liangchenghui,@wuxuejian
tags/v1.2.0-rc1
mindspore-ci-bot Gitee 5 years ago
parent
commit
d58d163593
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      mindspore/ccsrc/backend/kernel_compiler/gpu/arrays/array_reduce_gpu_kernel.h

+ 1
- 0
mindspore/ccsrc/backend/kernel_compiler/gpu/arrays/array_reduce_gpu_kernel.h View File

@@ -103,6 +103,7 @@ class ArrayReduceGpuKernel : public GpuKernel {
for (auto axis : attr_axis) {
axis < 0 ? axis_.push_back(axis + input_dim_length) : axis_.push_back(axis);
}
std::sort(axis_.begin(), axis_.end());
}
} else if (AnfAlgo::GetCNodePrimitive(kernel_node)->GetAttr("axis")->isa<Int64Imm>()) {
int axis = static_cast<int>(GetAttr<int64_t>(kernel_node, "axis"));


Loading…
Cancel
Save