Fixed CVS-93736 (#16471)

This commit is contained in:
Ilya Lavrenov 2023-03-22 14:20:03 +04:00 committed by GitHub
parent 57c91e0c56
commit 1b72352f6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,10 +100,8 @@ const ov::Shape& ov::descriptor::Tensor::get_shape() const {
size_t ov::descriptor::Tensor::size() const {
const bool bitwidth_less_than_byte = m_element_type.bitwidth() < 8;
if (bitwidth_less_than_byte) {
return static_cast<size_t>(ceil((1.0 * shape_size(get_shape()) * m_element_type.bitwidth()) / 8));
}
return shape_size(get_shape()) * m_element_type.size();
return bitwidth_less_than_byte ? (shape_size(get_shape()) * m_element_type.bitwidth() + 7) >> 3
: (shape_size(get_shape()) * m_element_type.size());
}
const std::unordered_set<std::string>& ov::descriptor::Tensor::get_names() const {