Files
openvino/ngraph/test/visitors/op/log_softmax.cpp
Wilson Seok a8f0109584 Migrate ngraph backend test/activations (#7973)
* Remove fp16 of Convert layer test from skip_tests.config.cpp as it works now

* update repo

* create new PR from PR7849

* remove backend tests of activation operations
2021-10-14 09:38:30 +03:00

34 lines
1.0 KiB
C++

// Copyright (C) 2018-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 "ngraph/opsets/opset3.hpp"
#include "ngraph/opsets/opset4.hpp"
#include "ngraph/opsets/opset5.hpp"
#include "util/visitor.hpp"
using namespace std;
using namespace ngraph;
using ngraph::test::NodeBuilder;
using ngraph::test::ValueMap;
TEST(attributes, logsoftmax_op) {
NodeBuilder::get_ops().register_factory<opset5::LogSoftmax>();
auto data = make_shared<op::Parameter>(element::f32, Shape{3, 2, 3});
int64_t axis = 2;
const auto logsoftmax = make_shared<opset5::LogSoftmax>(data, axis);
NodeBuilder builder(logsoftmax);
auto g_logsoftmax = ov::as_type_ptr<opset5::LogSoftmax>(builder.create());
const auto expected_attr_count = 1;
EXPECT_EQ(builder.get_value_map_size(), expected_attr_count);
EXPECT_EQ(g_logsoftmax->get_axis(), logsoftmax->get_axis());
}