Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear error message in the Constant::cast_vector #20629

Merged
merged 1 commit into from
Oct 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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