diff --git a/src/inference/include/ie/ie_blob.h b/src/inference/include/ie/ie_blob.h index fd463384260..d3373975773 100644 --- a/src/inference/include/ie/ie_blob.h +++ b/src/inference/include/ie/ie_blob.h @@ -155,7 +155,7 @@ public: * @brief Returns the size of the current Blob in bytes. * @return Blob's size in bytes */ - virtual size_t byteSize() const noexcept { + virtual size_t byteSize() const { return size() * element_size(); } @@ -169,7 +169,7 @@ public: * * @return Returns the number of bytes per element */ - virtual size_t element_size() const noexcept = 0; + virtual size_t element_size() const = 0; /** * @brief Allocates memory to store the data. @@ -364,11 +364,11 @@ public: * @brief Returns the size of the current Blob in bytes calculated as `size() * element_size()`. * @return Blob's size in bytes */ - size_t byteSize() const noexcept override { + size_t byteSize() const override { return (size() * tensorDesc.getPrecision().bitsSize() + 7) >> 3; } - size_t element_size() const noexcept override { + size_t element_size() const override { return tensorDesc.getPrecision().size(); } diff --git a/src/inference/include/ie/ie_compound_blob.h b/src/inference/include/ie/ie_compound_blob.h index 66dad9c6c47..06d6d5d91a0 100644 --- a/src/inference/include/ie/ie_compound_blob.h +++ b/src/inference/include/ie/ie_compound_blob.h @@ -52,13 +52,13 @@ public: * @brief Always returns `0` * @return Returns `0` */ - size_t byteSize() const noexcept override; + size_t byteSize() const override; /** * @brief Always returns `0` * @return Returns `0` */ - size_t element_size() const noexcept override; + size_t element_size() const override; /** * @brief No operation is performed. Compound blob does not allocate/deallocate any data diff --git a/src/inference/src/ie_compound_blob.cpp b/src/inference/src/ie_compound_blob.cpp index 0e2604047df..68743468de8 100644 --- a/src/inference/src/ie_compound_blob.cpp +++ b/src/inference/src/ie_compound_blob.cpp @@ -311,11 +311,11 @@ CompoundBlob::CompoundBlob(std::vector&& blobs) : CompoundBlob(Tensor this->_blobs = std::move(blobs); } -size_t CompoundBlob::byteSize() const noexcept { +size_t CompoundBlob::byteSize() const { return 0; } -size_t CompoundBlob::element_size() const noexcept { +size_t CompoundBlob::element_size() const { return 0; }