Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[CPU] Use elements count in the special nspc concat implementation (#26352)

Luwei Zhoue43b0713ae17
diff --git a/src/plugins/intel_cpu/src/nodes/concat.cpp b/src/plugins/intel_cpu/src/nodes/concat.cpp
index 6ca87ab31e6..2d8b7156368 100644
--- a/src/plugins/intel_cpu/src/nodes/concat.cpp
+++ b/src/plugins/intel_cpu/src/nodes/concat.cpp
@@ -559,8 +559,8 @@ void Concat::execNspcSpecCase() {
nonZeroInShapes++;
}
-
- const size_t iter_count = getParentEdgeAt(firstNonZeroEdge)->getMemory().getSize() / channelsDataSize[0];
+ const Shape& shape = getSrcMemoryAtPort(firstNonZeroEdge)->getShape();
+ const size_t iter_count = shape.getElementsCount() / shape.getStaticDims()[channelAxis];
parallel_for(iter_count, [&](int i) {
const size_t dst_off = i * channels_size;