Skip to content

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

[NPU] Don't get strides if not supported (#32197)

Bogdan Pereanu529fecf16692
diff --git a/src/plugins/intel_npu/src/backend/src/zero_tensor.cpp b/src/plugins/intel_npu/src/backend/src/zero_tensor.cpp
index dd53de9b622..3f58c55b2b6 100644
--- a/src/plugins/intel_npu/src/backend/src/zero_tensor.cpp
+++ b/src/plugins/intel_npu/src/backend/src/zero_tensor.cpp
@@ -61,7 +61,7 @@ ZeroTensor::ZeroTensor(const std::shared_ptr<ZeroInitStructsHolder>& init_struct
_element_type{user_tensor->get_element_type()},
_shape{user_tensor->get_shape()},
_capacity{_shape},
- _strides{user_tensor->get_strides()},
+ _strides{_element_type.bitwidth() >= 8 ? user_tensor->get_strides() : ov::Strides{}},
_strides_once{},
_imported_tensor(user_tensor) {
OPENVINO_ASSERT(_element_type.is_static());
@@ -152,7 +152,7 @@ void ZeroTensor::update_strides() const {
const ov::Strides& ZeroTensor::get_strides() const {
OPENVINO_ASSERT(_element_type.bitwidth() >= 8,
- "Could not get strides for types with bitwidths less then 8 bit. Tensor type: ",
+ "Could not get strides for types with bitwidths less than 8 bit. Tensor type: ",
_element_type);
std::call_once(_strides_once, &ZeroTensor::update_strides, this);
return _strides;