Skip to content

Commit

Permalink
Clear error message in the Constant::cast_vector (openvinotoolkit#20629)
Browse files Browse the repository at this point in the history
  • Loading branch information
jane-intel authored Oct 21, 2023
1 parent 0934d2a commit 94a6360
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/core/include/openvino/op/constant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,9 +485,19 @@ class OPENVINO_API Constant : public Op {
if (!std::is_same<OUT_T, IN_T>::value) {
OPENVINO_ASSERT(
!std::numeric_limits<IN_T>::is_signed || std::numeric_limits<OUT_T>::lowest() <= c,
"Cannot cast vector from constant. Some values are outside the range.");
"Cannot cast vector from ",
Type,
" constant to ",
element::from<OUT_T>(),
". Some values are outside the range. Example: ",
c);
OPENVINO_ASSERT(std::numeric_limits<OUT_T>::max() >= c,
"Cannot cast vector from constant. Some values are outside the range.");
"Cannot cast vector from ",
Type,
" constant to ",
element::from<OUT_T>(),
". Some values are outside the range. Example: ",
c);
}
#if defined(__clang__)
# pragma clang diagnostic pop
Expand Down

0 comments on commit 94a6360

Please sign in to comment.