OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
[npu] Improve test cover for NPU zero tensor (#40063)
Pawel Raasz33acbd7999b6
diff --git a/src/plugins/intel_npu/tests/functional/internal/backend/zero_tensor_tests.cpp b/src/plugins/intel_npu/tests/functional/internal/backend/zero_tensor_tests.cppindex 49777c02f48..1a37ec6deab 100644--- a/src/plugins/intel_npu/tests/functional/internal/backend/zero_tensor_tests.cpp+++ b/src/plugins/intel_npu/tests/functional/internal/backend/zero_tensor_tests.cpp@@ -617,6 +617,21 @@ TEST_P(ZeroTensorTestsCheckDataType, WrapNonContiguousUserTensorPreservesByteStrEXPECT_EQ(host_tensor->data(), zero_tensor->data());}+TEST_P(ZeroTensorTestsCheckDataType, IsContinuousDoesNotCrashForDenseTensors) {+ SKIP_IF_CURRENT_TEST_IS_DISABLED()++ std::shared_ptr<::intel_npu::IEngineBackend> engine_backend = std::make_shared<::intel_npu::ZeroEngineBackend>();+ auto zero_context = std::make_shared<::intel_npu::RemoteContextImpl>(engine_backend);++ for (const auto& shape : {Shape{2, 16}, Shape{1, 2, 2, 2}, Shape{3, 5}}) {+ auto host_tensor = std::make_shared<::intel_npu::ZeroHostTensor>(zero_context, init_struct, element_type, shape);+ EXPECT_TRUE(host_tensor->is_continuous()) << shape;++ auto zero_tensor = std::make_shared<::intel_npu::ZeroTensor>(init_struct, element_type, shape, true);+ EXPECT_TRUE(zero_tensor->is_continuous()) << shape;+ }+}+} // namespace behavior} // namespace test} // namespace ov