add visitor attribute test case

This commit is contained in:
DD 2021-06-09 15:01:52 +08:00
parent 948ec772e0
commit 610728f1ab
2 changed files with 26 additions and 0 deletions

View File

@ -264,6 +264,7 @@ set(SRC
visitors/op/roi_pooling.cpp
visitors/op/shuffle_channels.cpp
visitors/op/softmax.cpp
visitors/op/softplus.cpp
visitors/op/space_to_depth.cpp
visitors/op/split.cpp
visitors/op/squared_difference.cpp

View File

@ -0,0 +1,25 @@
// Copyright (C) 2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "gtest/gtest.h"
#include "ngraph/ngraph.hpp"
#include "ngraph/opsets/opset1.hpp"
#include "util/visitor.hpp"
using namespace std;
using namespace ngraph;
using ngraph::test::NodeBuilder;
using ngraph::test::ValueMap;
TEST(attributes, softplus)
{
NodeBuilder::get_ops().register_factory<opset1::Squeeze>();
const auto data_node = make_shared<op::Parameter>(element::f32, Shape{1});
const auto result = make_shared<op::v4::SoftPlus>(data_node);
NodeBuilder builder(result);
const auto expected_attr_count = 0;
EXPECT_EQ(builder.get_value_map_size(), expected_attr_count);
}