Commit 432e037d authored by mbencer's avatar mbencer

Code review remarks introduced

parent c732705f
...@@ -42,22 +42,20 @@ op::NormalizeL2::NormalizeL2(const Output<Node>& data, ...@@ -42,22 +42,20 @@ op::NormalizeL2::NormalizeL2(const Output<Node>& data,
void op::NormalizeL2::pre_validate_and_infer_types() void op::NormalizeL2::pre_validate_and_infer_types()
{ {
auto axes_node = input(1).get_source_output().get_node_shared_ptr(); auto axes_node = input_value(1).get_node_shared_ptr();
const auto& input_pshape = get_input_partial_shape(0); const auto& input_pshape = get_input_partial_shape(0);
const auto& axes_pshape = get_input_partial_shape(1); const auto& axes_pshape = get_input_partial_shape(1);
const auto& input_rank = input_pshape.rank(); const auto& input_rank = input_pshape.rank();
const auto& axes_rank = axes_pshape.rank(); const auto& axes_rank = axes_pshape.rank();
NODE_VALIDATION_CHECK(this, NODE_VALIDATION_CHECK(this, axes_node->is_constant(), "Input axes must be Constant type");
axes_node->is_constant(),
"doesn't support 'axes' input of other type than a Constant.");
if (axes_rank.is_static()) if (axes_rank.is_static())
{ {
NODE_VALIDATION_CHECK(this, NODE_VALIDATION_CHECK(this,
static_cast<size_t>(axes_pshape.rank()) == 1, static_cast<size_t>(axes_rank) == 1,
"Input axes must have rank equals 1 (axes shape: ", "Input axes must have rank equals 1 (axes rank: ",
axes_pshape, axes_rank,
")."); ").");
if (input_rank.is_static()) if (input_rank.is_static())
......
...@@ -37,9 +37,7 @@ TEST(type_prop, normalize_axes_input_not_constant) ...@@ -37,9 +37,7 @@ TEST(type_prop, normalize_axes_input_not_constant)
} }
catch (const NodeValidationFailure& error) catch (const NodeValidationFailure& error)
{ {
EXPECT_HAS_SUBSTRING( EXPECT_HAS_SUBSTRING(error.what(), std::string("Input axes must be Constant type"));
error.what(),
std::string("doesn't support 'axes' input of other type than a Constant."));
} }
catch (...) catch (...)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment