Browse Source

!2696 [bugfix]:Attr of axis of ReduceSum is invalid

Merge pull request !2696 from zyli2020/bug_fix
tags/v0.6.0-beta
mindspore-ci-bot Gitee 5 years ago
parent
commit
fafdfa9a03
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      mindspore/ccsrc/kernel/gpu/arrays/array_reduce_gpu_kernel.h

+ 2
- 1
mindspore/ccsrc/kernel/gpu/arrays/array_reduce_gpu_kernel.h View File

@@ -94,7 +94,8 @@ class ArrayReduceGpuKernel : public GpuKernel {
}
int input_dim_length = SizeToInt(AnfAlgo::GetPrevNodeOutputInferShape(kernel_node, 0).size());

if (AnfAlgo::GetCNodePrimitive(kernel_node)->GetAttr("axis")->isa<ValueTuple>()) {
if (AnfAlgo::GetCNodePrimitive(kernel_node)->GetAttr("axis")->isa<ValueTuple>() ||
AnfAlgo::GetCNodePrimitive(kernel_node)->GetAttr("axis")->isa<ValueList>()) {
auto attr_axis = GetAttr<std::vector<int>>(kernel_node, "axis");
if (attr_axis.empty()) {
axis_.push_back(-1);


Loading…
Cancel
Save