Skip to content

Commit

Permalink
Update the Swish OP visistor API to use typed test.
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 a96e05c commit 15227af
Showing 1 changed file with 7 additions and 22 deletions.
29 changes: 7 additions & 22 deletions ngraph/test/visitors/op/swish.cpp
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
// Copyright (C) 2018-2021 Intel Corporation
// Copyright (C) 2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "unary_ops.hpp"

#include "gtest/gtest.h"
using Type = ::testing::Types<UnaryOperatorType<ngraph::op::v4::Swish, element::f32>>;

#include "ngraph/ngraph.hpp"
#include "ngraph/op/util/attr_types.hpp"
#include "ngraph/opsets/opset4.hpp"
#include "util/visitor.hpp"

using namespace std;
using namespace ngraph;
using ngraph::test::NodeBuilder;

TEST(attributes, swish_op)
{
NodeBuilder::get_ops().register_factory<opset4::Swish>();
const auto A = make_shared<op::Parameter>(element::f32, Shape{5, 2});

const auto swish = make_shared<opset4::Swish>(A);
NodeBuilder builder(swish);

const auto expected_attr_count = 0;
EXPECT_EQ(builder.get_value_map_size(), expected_attr_count);
}
INSTANTIATE_TYPED_TEST_CASE_P(visitor_without_atrribute,
UnaryOperatorVisitor,
Type,
UnaryOperatorTypeName);

0 comments on commit 15227af

Please sign in to comment.