diff --git a/src/core/shape_inference/include/squeeze_shape_inference.hpp b/src/core/shape_inference/include/squeeze_shape_inference.hpp index b240630f81d..8e7f140d017 100644 --- a/src/core/shape_inference/include/squeeze_shape_inference.hpp +++ b/src/core/shape_inference/include/squeeze_shape_inference.hpp @@ -30,6 +30,7 @@ void shape_infer(const Squeeze* op, NODE_VALIDATION_CHECK(op, output_shapes.size() == 1); const auto number_of_inputs = input_shapes.size(); + OPENVINO_ASSERT(!input_shapes.empty()); const auto& arg_shape = input_shapes[0]; auto& output_shape = output_shapes[0]; diff --git a/src/core/src/type/float16.cpp b/src/core/src/type/float16.cpp index 59a69d6a847..5f2b1e48cd1 100644 --- a/src/core/src/type/float16.cpp +++ b/src/core/src/type/float16.cpp @@ -97,8 +97,12 @@ float16::float16(float value) { // Restore the hidden 1 frac = 0x04000000 | ((iv & fmask_32) << 3); // Will any bits be shifted off? - uint32_t sticky = (frac & ((1 << (1 - biased_exp_16)) - 1)) ? 1 : 0; - frac >>= 1 + (-biased_exp_16); + int32_t shift = biased_exp_16 < -30 ? 0 : (1 << (1 - biased_exp_16)); + uint32_t sticky = (frac & (shift - 1)) ? 1 : 0; + if (1 + (-biased_exp_16) > 31) + frac = 0; + else + frac >>= 1 + (-biased_exp_16); frac |= sticky; if (((frac & rhalf_16) == rodd_16) || ((frac & rnorm_16) != 0)) { frac += reven_16;