Skip to content

Commit 15227af

Browse files
committed
Update the Swish OP visistor API to use typed test.
Signed-off-by: Luwei Zhou <luwei.zhou@intel.com>
1 parent a96e05c commit 15227af

File tree

1 file changed

+7
-22
lines changed

1 file changed

+7
-22
lines changed

ngraph/test/visitors/op/swish.cpp

+7-22
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,11 @@
1-
// Copyright (C) 2018-2021 Intel Corporation
1+
// Copyright (C) 2021 Intel Corporation
22
// SPDX-License-Identifier: Apache-2.0
33
//
4+
#include "unary_ops.hpp"
45

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

7-
#include "ngraph/ngraph.hpp"
8-
#include "ngraph/op/util/attr_types.hpp"
9-
#include "ngraph/opsets/opset4.hpp"
10-
#include "util/visitor.hpp"
11-
12-
using namespace std;
13-
using namespace ngraph;
14-
using ngraph::test::NodeBuilder;
15-
16-
TEST(attributes, swish_op)
17-
{
18-
NodeBuilder::get_ops().register_factory<opset4::Swish>();
19-
const auto A = make_shared<op::Parameter>(element::f32, Shape{5, 2});
20-
21-
const auto swish = make_shared<opset4::Swish>(A);
22-
NodeBuilder builder(swish);
23-
24-
const auto expected_attr_count = 0;
25-
EXPECT_EQ(builder.get_value_map_size(), expected_attr_count);
26-
}
8+
INSTANTIATE_TYPED_TEST_CASE_P(visitor_without_atrribute,
9+
UnaryOperatorVisitor,
10+
Type,
11+
UnaryOperatorTypeName);

0 commit comments

Comments
 (0)