forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
framework_node.cpp
43 lines (35 loc) · 1.17 KB
/
framework_node.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright (C) 2018-2024 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "openvino/op/util/framework_node.hpp"
#include <gtest/gtest.h>
#include <vector>
TEST(framework_node, attrs) {
ov::op::util::FrameworkNodeAttrs attrs;
attrs.set_opset_name("opset_name");
ASSERT_EQ(attrs.get_opset_name(), "opset_name");
attrs.set_type_name("type_name");
ASSERT_EQ(attrs.get_type_name(), "type_name");
attrs["attr1"] = "value1";
ASSERT_EQ(attrs.at("attr1"), "value1");
ASSERT_EQ(attrs.begin()->first, "attr1");
ASSERT_EQ(attrs.begin()->first, "attr1");
ASSERT_EQ(attrs.begin()->second, "value1");
ov::op::util::FrameworkNodeAttrs a1, a2;
a1.set_type_name("type_name");
a2.set_type_name("type_name_");
ASSERT_FALSE(a1 == a2);
a2.set_type_name("type_name");
ASSERT_TRUE(a1 == a2);
a1.set_opset_name("opset_name");
a2.set_opset_name("opset_name_");
ASSERT_FALSE(a1 == a2);
a2.set_opset_name("opset_name");
ASSERT_TRUE(a1 == a2);
a1["attr"] = "value";
ASSERT_FALSE(a1 == a2);
a2["attr"] = "value_";
ASSERT_FALSE(a1 == a2);
a2["attr"] = "value";
ASSERT_TRUE(a1 == a2);
}