From 3de41ec50a5d777fef0bac8464fdffa4d3366598 Mon Sep 17 00:00:00 2001 From: Patryk Elszkowski Date: Tue, 11 May 2021 07:54:19 +0200 Subject: [PATCH] add zero attribute test for tanh op (#5427) * add zero attribute test for tanh op * apply review suggestion Co-authored-by: Patryk Elszkowski --- ngraph/test/CMakeLists.txt | 1 + ngraph/test/visitors/op/tanh.cpp | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 ngraph/test/visitors/op/tanh.cpp diff --git a/ngraph/test/CMakeLists.txt b/ngraph/test/CMakeLists.txt index 6347b884b81..961f9b893a4 100644 --- a/ngraph/test/CMakeLists.txt +++ b/ngraph/test/CMakeLists.txt @@ -258,6 +258,7 @@ set(SRC visitors/op/squeeze.cpp visitors/op/sqrt.cpp visitors/op/strided_slice.cpp + visitors/op/tanh.cpp visitors/op/topk.cpp visitors/op/transpose.cpp uint4.cpp diff --git a/ngraph/test/visitors/op/tanh.cpp b/ngraph/test/visitors/op/tanh.cpp new file mode 100644 index 00000000000..ac915bc7025 --- /dev/null +++ b/ngraph/test/visitors/op/tanh.cpp @@ -0,0 +1,27 @@ +// Copyright (C) 2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#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(); + const auto data_node = make_shared(element::f32, Shape{1}); + const auto tanh = make_shared(data_node); + + const NodeBuilder builder(tanh); + const auto tanh_attr_number = 0; + + EXPECT_EQ(builder.get_value_map_size(), tanh_attr_number); +}