Skip to content

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

Try to fix 1D transpose unit test (#30761)

liang0f55c3d08cbf
diff --git a/src/plugins/intel_cpu/src/nodes/common/permute_kernel.cpp b/src/plugins/intel_cpu/src/nodes/common/permute_kernel.cpp
index f7e67a10e93..d3e5fd7388f 100644
--- a/src/plugins/intel_cpu/src/nodes/common/permute_kernel.cpp
+++ b/src/plugins/intel_cpu/src/nodes/common/permute_kernel.cpp
@@ -220,6 +220,16 @@ void PermuteKernel::optimizedExecute(const uint8_t* src_data, const uint8_t* dst
}
switch (jcp.n) {
+ case 0:
+ // This is a degenerate case that is only possible if the tensor has 0 or 1st rank
+ // Such a situation is possible in the following graph:
+ // Parameter
+ // |
+ // Transpose
+ // |
+ // Result
+ // The elimination of the Transpose node will not be performed
+ // So copy from input buffer to output buffer without any permutation
case 1:
parallel_for(dst_dims[0], [&](int i0) {
auto arg = jit_args_permute();