Port 15303 (#15354)

* Try to fix fuzzer tests

* Try to fix test
This commit is contained in:
Ilya Churaev
2023-01-27 12:58:47 +04:00
committed by GitHub
parent 5770daf303
commit 4211cc38b8
2 changed files with 7 additions and 2 deletions

View File

@@ -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];

View File

@@ -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;