diff --git a/src/common/util/include/openvino/util/file_util.hpp b/src/common/util/include/openvino/util/file_util.hpp index bc01d1aa724..e74054e17e2 100644 --- a/src/common/util/include/openvino/util/file_util.hpp +++ b/src/common/util/include/openvino/util/file_util.hpp @@ -119,7 +119,7 @@ bool directory_exists(const std::string& path); * @param[in] path The file name * @return file size */ -inline uint64_t file_size(const char* path) { +inline int64_t file_size(const char* path) { #if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) std::wstring widefilename = ov::util::string_to_wstring(path); const wchar_t* file_name = widefilename.c_str(); @@ -143,7 +143,7 @@ inline uint64_t file_size(const char* path) { * @param[in] path The file name * @return file size */ -inline uint64_t file_size(const std::wstring& path) { +inline int64_t file_size(const std::wstring& path) { return file_size(wstring_to_string(path).c_str()); } @@ -154,7 +154,7 @@ inline uint64_t file_size(const std::wstring& path) { * @param[in] path The file name * @return file size */ -inline uint64_t file_size(const std::string& path) { +inline int64_t file_size(const std::string& path) { return file_size(path.c_str()); } diff --git a/src/core/shape_inference/include/convolution_shape_inference.hpp b/src/core/shape_inference/include/convolution_shape_inference.hpp index 8e38c53cdd3..d55e8223358 100644 --- a/src/core/shape_inference/include/convolution_shape_inference.hpp +++ b/src/core/shape_inference/include/convolution_shape_inference.hpp @@ -28,22 +28,22 @@ int64_t calculate_num_spatial(const ConvType* op, num_spatial = filters_rank.get_length() - num_non_spatial_filter_dims; if (const auto &size = op->m_dilations.size()) { - NODE_VALIDATION_CHECK(op, num_spatial == -1 || num_spatial == size, + NODE_VALIDATION_CHECK(op, num_spatial == -1 || num_spatial == static_cast(size), "Dilations should be defined for all and only spatial dimensions."); num_spatial = static_cast(size); } if (const auto &size = op->m_strides.size()) { - NODE_VALIDATION_CHECK(op, num_spatial == -1 || num_spatial == size, + NODE_VALIDATION_CHECK(op, num_spatial == -1 || num_spatial == static_cast(size), "Strides should be defined for all and only spatial dimensions."); num_spatial = static_cast(size); } if (const auto &size = op->m_pads_begin.size()) { - NODE_VALIDATION_CHECK(op, num_spatial == -1 || num_spatial == size, + NODE_VALIDATION_CHECK(op, num_spatial == -1 || num_spatial == static_cast(size), "Pads begin should be defined for all and only spatial dimensions."); num_spatial = static_cast(size); } if (const auto &size = op->m_pads_end.size()) { - NODE_VALIDATION_CHECK(op, num_spatial == -1 || num_spatial == size, + NODE_VALIDATION_CHECK(op, num_spatial == -1 || num_spatial == static_cast(size), "Pads begin should be defined for all and only spatial dimensions."); num_spatial = static_cast(size); } @@ -349,7 +349,7 @@ int64_t calculate_num_spatial(const ConvType* op, num_spatial = calculate_num_spatial( op, input_shape, filters_shape, num_non_spatial_data_dims, num_non_spatial_filter_dims); if (const auto &size = op->m_output_padding.size()) { - NODE_VALIDATION_CHECK(op, num_spatial == -1 || num_spatial == size, + NODE_VALIDATION_CHECK(op, num_spatial == -1 || num_spatial == static_cast(size), "Output padding should be defined for all and only spatial dimensions."); num_spatial = static_cast(size); } diff --git a/src/core/src/op/lstm_sequence.cpp b/src/core/src/op/lstm_sequence.cpp index b1dac127dbf..c3ae41b0385 100644 --- a/src/core/src/op/lstm_sequence.cpp +++ b/src/core/src/op/lstm_sequence.cpp @@ -308,8 +308,8 @@ void op::v0::LSTMSequence::validate_and_infer_types() { auto merged_num_directions = Dimension::dynamic(); auto result_et = element::dynamic; - // Copy all inputs without peephole and initial_cell_state information for further - // validation + NODE_VALIDATION_CHECK(this, get_input_size() > 0, "The number of inputs of the LSTMSequence op cannot be zero."); + // Copy all inputs without peephole and initial_cell_state information for further validation for (size_t i = 0; i < get_input_size() - 1; i++) { // exclude initial_cell_state from the loop if (i != 2) { diff --git a/src/frontends/ir/src/ir_deserializer.cpp b/src/frontends/ir/src/ir_deserializer.cpp index cb4dbfdd199..7425370441e 100644 --- a/src/frontends/ir/src/ir_deserializer.cpp +++ b/src/frontends/ir/src/ir_deserializer.cpp @@ -550,7 +550,7 @@ GenericLayerParams XmlDeserializer::parseGenericParams(const pugi::xml_node& nod bool input) -> GenericLayerParams::LayerPortData { GenericLayerParams::LayerPortData port; - port.portId = XMLParseUtils::GetIntAttr(parentNode, "id"); + port.portId = XMLParseUtils::GetUIntAttr(parentNode, "id"); FOREACH_CHILD (node, parentNode, "dim") { int64_t dim = 0; @@ -590,7 +590,7 @@ GenericLayerParams XmlDeserializer::parseGenericParams(const pugi::xml_node& nod }; GenericLayerParams params; - params.layerId = XMLParseUtils::GetIntAttr(node, "id"); + params.layerId = XMLParseUtils::GetUIntAttr(node, "id"); params.version = XMLParseUtils::GetStrAttr(node, "version"); params.type = XMLParseUtils::GetStrAttr(node, "type"); diff --git a/src/frontends/onnx/onnx_common/src/onnx_model_validator.cpp b/src/frontends/onnx/onnx_common/src/onnx_model_validator.cpp index 4cadb62e3d3..5594a443955 100644 --- a/src/frontends/onnx/onnx_common/src/onnx_model_validator.cpp +++ b/src/frontends/onnx/onnx_common/src/onnx_model_validator.cpp @@ -71,7 +71,7 @@ bool is_correct_onnx_field(const PbKey& decoded_key) { * Each consecutive varint byte needs to be left-shifted "7 x its position in the vector" * and bitwise added to the accumulator afterward. */ -uint32_t varint_bytes_to_number(const std::vector& bytes) { +uint32_t varint_bytes_to_number(const std::vector& bytes) { uint32_t accumulator = 0u; for (size_t i = 0; i < bytes.size(); ++i) { @@ -84,7 +84,7 @@ uint32_t varint_bytes_to_number(const std::vector& bytes) { } uint32_t decode_varint(std::istream& model) { - std::vector bytes; + std::vector bytes; // max 4 bytes for a single value because this function returns a 32-bit long decoded varint const size_t MAX_VARINT_BYTES = 4u; // optimization to avoid allocations during push_back calls @@ -96,7 +96,7 @@ uint32_t decode_varint(std::istream& model) { // keep reading all bytes which have the MSB on from the stream while (key_component & 0x80 && bytes.size() < MAX_VARINT_BYTES) { // drop the most significant bit - const char component = key_component & ~0x80; + const uint8_t component = key_component & ~0x80; bytes.push_back(component); model.get(key_component); }