From 293fccc4fe7d4499e136aa34d1d966ebbb5a4ebb Mon Sep 17 00:00:00 2001 From: Evgenya Stepyreva Date: Wed, 17 May 2023 16:28:50 +0400 Subject: [PATCH] Normalize_L2 relax constant input restriction (#17568) * Normalize_L2 relax constant input restriction * Fix warning treated as error during windows build --- src/core/src/op/normalize_l2.cpp | 2 -- src/core/tests/type_prop/normalize_l2.cpp | 11 +---------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/src/core/src/op/normalize_l2.cpp b/src/core/src/op/normalize_l2.cpp index 438f2f2ac5b..65456dafef8 100644 --- a/src/core/src/op/normalize_l2.cpp +++ b/src/core/src/op/normalize_l2.cpp @@ -38,8 +38,6 @@ void op::v0::NormalizeL2::validate_and_infer_types() { const auto& input_rank = input_pshape.rank(); const auto& axes_rank = axes_pshape.rank(); - NODE_VALIDATION_CHECK(this, has_and_set_equal_bounds(input_value(1)), "Input axes must be Constant type"); - if (axes_rank.is_static()) { NODE_VALIDATION_CHECK(this, axes_rank.get_length() <= 1, diff --git a/src/core/tests/type_prop/normalize_l2.cpp b/src/core/tests/type_prop/normalize_l2.cpp index 3d4e6de9317..20836408d85 100644 --- a/src/core/tests/type_prop/normalize_l2.cpp +++ b/src/core/tests/type_prop/normalize_l2.cpp @@ -39,16 +39,7 @@ TEST(type_prop, normalize_l2_axes_input_not_constant) { auto axes = make_shared(element::u64, Shape{1}); float eps{1e-6f}; auto eps_mode = op::EpsMode::ADD; - - try { - auto normalize = make_shared(data, axes, eps, eps_mode); - // Should have thrown, so fail if it didn't - FAIL() << "Invalid input tensor rank."; - } catch (const NodeValidationFailure& error) { - EXPECT_HAS_SUBSTRING(error.what(), std::string("Input axes must be Constant type")); - } catch (...) { - FAIL() << "Deduced type check failed for unexpected reason"; - } + ASSERT_NO_THROW(auto op = make_shared(data, axes, eps, eps_mode)); } TEST(type_prop, normalize_l2_invalid_axes_rank) {