Skip to content

Commit

Permalink
add invalid axe check
Browse files Browse the repository at this point in the history
  • Loading branch information
alvoron committed May 3, 2024
1 parent 20e824b commit 6873c49
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/plugins/intel_cpu/src/nodes/executors/acl/acl_reduce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ bool AclReduceExecutor::init(const ReduceAttrs& reduceAttrs,
auto pos = axisCast(i, reduceAttrs.axes.size());
if (srcDescs[0]->hasLayoutType(LayoutType::nspc)) {
axe = getAxeNchwLayout(axe);
if (axe == -1) return false;
}
axesMean.set(pos, axe);
}
Expand All @@ -90,6 +91,7 @@ bool AclReduceExecutor::init(const ReduceAttrs& reduceAttrs,
int axis = axisCast(reduceAttrs.axes[0], srcDims.size());
if (srcDescs[0]->hasLayoutType(LayoutType::nspc)) {
axis = getAxeNchwLayout(axis);
if (axis == -1) return false;
}
Status reductionOperationStatus = NEReductionOperation::validate(&srcTensorInfo, &dstTensorInfo, axis,
getAclReductionOperationByAlgorithm(reduceAttrs.operation), reduceAttrs.keepDims);
Expand Down

0 comments on commit 6873c49

Please sign in to comment.