Skip to content

Commit

Permalink
Add Swish unsupported parameter data type test cases.
Browse files Browse the repository at this point in the history
Signed-off-by: Luwei Zhou <[email protected]>
  • Loading branch information
luweizhou2016 committed Jun 22, 2021
1 parent 697d7c3 commit a96e05c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ngraph/test/type_prop/swish.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,17 @@ TEST(type_prop, swish_2_inputs)
ASSERT_TRUE(swish_func->get_output_partial_shape(0).same_scheme(data->get_output_shape(0)));
ASSERT_TRUE(swish_func->get_output_partial_shape(0).rank().is_static());
}

TEST(type_prop, swish_incompatible_type_boolean)
{
auto data = make_shared<op::Parameter>(element::boolean, Shape{1, 3, 6});
auto beta = make_shared<op::Parameter>(element::f32, Shape{});
ASSERT_THROW(make_shared<op::v4::Swish>(data, beta);, ngraph::NodeValidationFailure);
}

TEST(type_prop, swish_incompatible_types_u32)
{
auto data = make_shared<op::Parameter>(element::f32, Shape{1, 3, 6});
auto beta = make_shared<op::Parameter>(element::u32, Shape{});
ASSERT_THROW(make_shared<op::v4::Swish>(data, beta);, ngraph::NodeValidationFailure);
}

0 comments on commit a96e05c

Please sign in to comment.