forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-Migrate OP Tanh to use RTTI; -Remove the using namespace in the header file -Migrate the Swish and Tanh visitor test to use template code Signed-off-by: Luwei Zhou <[email protected]>
- Loading branch information
1 parent
e7b0fc2
commit b686c93
Showing
16 changed files
with
34 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,12 @@ | ||
// Copyright (C) 2018-2021 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
#include "unary_ops.hpp" | ||
|
||
#include "gtest/gtest.h" | ||
|
||
#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, mish_op) | ||
{ | ||
NodeBuilder::get_ops().register_factory<opset4::Mish>(); | ||
const auto A = make_shared<op::Parameter>(element::f32, Shape{5, 2}); | ||
|
||
const auto mish = make_shared<opset4::Mish>(A); | ||
NodeBuilder builder(mish); | ||
using Type = ::testing::Types<UnaryOperatorType<ngraph::op::v4::Mish, element::f32>>; | ||
|
||
const auto expected_attr_count = 0; | ||
EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); | ||
} | ||
INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, | ||
UnaryOperatorVisitor, | ||
Type, | ||
UnaryOperatorTypeName); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,12 @@ | ||
// Copyright (C) 2021 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
#include "unary_ops.hpp" | ||
|
||
#include "gtest/gtest.h" | ||
|
||
#include "ngraph/ngraph.hpp" | ||
#include "ngraph/op/util/attr_types.hpp" | ||
#include "ngraph/opsets/opset1.hpp" | ||
|
||
#include "util/visitor.hpp" | ||
|
||
using namespace std; | ||
using namespace ngraph; | ||
using ngraph::test::NodeBuilder; | ||
|
||
TEST(attributes, tanh_op) | ||
{ | ||
NodeBuilder::get_ops().register_factory<op::Tanh>(); | ||
const auto data_node = make_shared<op::Parameter>(element::f32, Shape{1}); | ||
const auto tanh = make_shared<op::Tanh>(data_node); | ||
|
||
const NodeBuilder builder(tanh); | ||
const auto tanh_attr_number = 0; | ||
using Type = ::testing::Types<UnaryOperatorType<ngraph::op::v0::Tanh, element::f32>>; | ||
|
||
EXPECT_EQ(builder.get_value_map_size(), tanh_attr_number); | ||
} | ||
INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, | ||
UnaryOperatorVisitor, | ||
Type, | ||
UnaryOperatorTypeName); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters