diff --git a/src/core/src/bound_evaluate.cpp b/src/core/src/bound_evaluate.cpp index f90c81385e4..0148f05c429 100644 --- a/src/core/src/bound_evaluate.cpp +++ b/src/core/src/bound_evaluate.cpp @@ -176,7 +176,13 @@ ov::Tensor or_tensor(const ov::Tensor& lhs, const ov::Tensor& rhs) { struct TensorVectorCmp { bool operator()(const ov::TensorVector& lhs, const ov::TensorVector& rhs) const { - return !std::equal(lhs.begin(), lhs.end(), rhs.begin(), &are_same_tensor); + auto rhs_it = rhs.begin(); + return std::any_of(lhs.begin(), lhs.end(), [&rhs_it](const ov::Tensor& lhs) { + bool is_less = + (lhs && *rhs_it) ? lhs.data() < rhs_it->data() : static_cast(lhs) < static_cast(*rhs_it); + ++rhs_it; + return is_less; + }); } };