From 5170814b073eca5a8a41734a660eb528b25b5d1b Mon Sep 17 00:00:00 2001 From: MATEUSZ MIKOLAJCZYK Date: Thu, 28 Nov 2024 18:17:52 +0000 Subject: [PATCH] Apply requested changes Signed-off-by: MATEUSZ MIKOLAJCZYK --- src/plugins/intel_cpu/src/nodes/strided_slice.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/plugins/intel_cpu/src/nodes/strided_slice.cpp b/src/plugins/intel_cpu/src/nodes/strided_slice.cpp index 3890d47d9093fc..fe1c9604d30b1f 100644 --- a/src/plugins/intel_cpu/src/nodes/strided_slice.cpp +++ b/src/plugins/intel_cpu/src/nodes/strided_slice.cpp @@ -76,11 +76,9 @@ StridedSlice::StridedSlice(const std::shared_ptr& op, const GraphConte isConstantInput[i] = ov::is_type(op->get_input_node_shared_ptr(i)); if (!isConstantInput[i] && one_of(i, attrs.BEGIN_ID, attrs.END_ID, attrs.STRIDE_ID)) { hasConstAttrInputs = false; - if (!attrs.isSliceScatterOp) { - shapeHasDataDependency = true; - } } } + shapeHasDataDependency = attrs.isSliceScatterOp ? false : (!hasConstAttrInputs); if (isAxesSpecified) { hasConstAttrInputs &= isConstantInput[attrs.AXES_ID]; } @@ -327,11 +325,14 @@ bool StridedSlice::needShapeInfer() const { } void StridedSlice::execute(dnnl::stream strm) { - if (!execPtr && !Node::isDynamic) { + if (!execPtr) { + if (!isDynamicNode() && !hasConstAttrInputs) { // SliceScatter due to not having data dependency on shape may not call prepareParams when start/stop/step values are non-constant in Static execution. + // In Slice and SliceScatter op, prepareParams would be called by createPrimitive (if const inputs) or by updateDynamicParams in case of dynamic node. StridedSlice::prepareParams(); - } else if (!execPtr) { - OPENVINO_THROW(errorPrefix, "doesn't have compiled executor!"); + } else { + OPENVINO_THROW(errorPrefix, "doesn't have compiled executor!"); + } } execPtr->exec(srcMemory, dstMemory); }