Skip to content

Commit

Permalink
Fixed CVS-93736 (openvinotoolkit#16471)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lavrenov committed Mar 22, 2023
1 parent 57c91e0 commit 1b72352
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/core/src/descriptor/tensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 1b72352

Please sign in to comment.