Add missing check for special zero (#17479)
This commit is contained in:
committed by
GitHub
parent
804df84f7d
commit
a7f6f5292e
@@ -71,7 +71,7 @@ public:
|
||||
}
|
||||
size_t inputProduct = 1;
|
||||
for (size_t i = 0; i < inputShapeSize; ++i) {
|
||||
if (i < outputPatternSize && outPattern[i] == 0)
|
||||
if (i < outputPatternSize && outPattern[i] == 0 && m_specialZero)
|
||||
continue;
|
||||
inputProduct *= inputShape[i];
|
||||
}
|
||||
|
||||
@@ -265,6 +265,20 @@ const auto params_NonZero = ::testing::Combine(::testing::Values(shape_NonZero),
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(smoke_CompareWithRefs_NonZero, ShapeOpsCPUTest, params_NonZero, ShapeOpsCPUTest::getTestCaseName);
|
||||
|
||||
// test cases about reshape with empty tensor
|
||||
inputDescription shape_EmptyTensor{{{-1, 2, 2},
|
||||
{ngraph::Shape{0, 2, 2}, ngraph::Shape{2, 2, 2}}},
|
||||
{std::vector<int>{0, 4}, std::vector<int>{2, 4}}};
|
||||
|
||||
const auto params_EmptyTensor = ::testing::Combine(::testing::Values(shape_EmptyTensor),
|
||||
::testing::Values(ngraph::helpers::InputLayerType::PARAMETER),
|
||||
::testing::Values(shapeNodeType::Reshape),
|
||||
::testing::Values(Precision::FP32),
|
||||
::testing::ValuesIn(secondInPrcs),
|
||||
::testing::Values(false));
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(smoke_CompareWithRefs_EmptyTensor, ShapeOpsCPUTest, params_EmptyTensor, ShapeOpsCPUTest::getTestCaseName);
|
||||
|
||||
} // namespace reshapeTest
|
||||
|
||||
namespace squeezeTest {
|
||||
|
||||
Reference in New Issue
Block a user