Introduced OpenVINO RTTI and add version string to operations (#7288)

* Introduced OpenVINO RTTI and add version string to operations

* Fixed build

* Try to fix build

* Removed get_type_info_static

* Fixed tests

* Moved ov operations to new macros

* Fixed type_info_static

* Introduce new header only declaration

* Deprecate type_info static member

* Introduced OPENVINO_OPERATION macro

* Fixed ngraph lib with new RTTI

* Fixed unit tests

* Fixed code style

* Fixed VPU common

* Fixed all target for macOS

* Changed macto to OPENVINO_OP

* Changed cldnn

* Fixed typo

* Fixed some unit tests with old operations

* Fixed DiscreteTypeInfo

* Fixed type relaxed operations

* Fixed legacy tests

* Fixed naming style

* Fixed cpuTests

* Disabled deprecation to pass CI

* Added compatibility to internal operations

* Added BWDCMP for internal ops

* Deprecate type_info

* Fixed Slice RTTI

* Fixed Myriad

* Applied patch from PR 7573
This commit is contained in:
Ilya Churaev
2021-09-23 13:29:39 +03:00
committed by GitHub
parent fae40f3ef8
commit 634759210f
568 changed files with 3963 additions and 4340 deletions

View File

@@ -48,6 +48,7 @@ set(SRC
main.cpp
matcher_pass.cpp
misc.cpp
rtti.cpp
node_input_output.cpp
rtti.cpp
op.cpp

View File

@@ -87,14 +87,10 @@ namespace ov {
template <>
class VariantWrapper<Ship> : public VariantImpl<Ship> {
public:
static constexpr VariantTypeInfo type_info{"Variant::Ship", 0};
const VariantTypeInfo& get_type_info() const override {
return type_info;
}
OPENVINO_RTTI("VariantWrapper<Ship>");
VariantWrapper(const value_type& value) : VariantImpl<value_type>(value) {}
};
constexpr VariantTypeInfo VariantWrapper<Ship>::type_info;
} // namespace ov
TEST(op, variant) {

View File

@@ -18,8 +18,6 @@ using namespace std;
using namespace ngraph;
using namespace ngraph::opset7;
constexpr ngraph::VariantTypeInfo ngraph::VariantWrapper<ngraph::VariableContext>::type_info;
shared_ptr<ngraph::Function> AssignReadGraph() {
auto p = make_shared<op::Parameter>(element::f32, Shape{3});
auto variable = make_shared<Variable>(VariableInfo{PartialShape::dynamic(), element::dynamic, "var_1"});

File diff suppressed because it is too large Load Diff

View File

@@ -8,23 +8,18 @@
#include "util/visitor.hpp"
template <typename T, ngraph::element::Type_t ELEMENT_TYPE>
class UnaryOperatorType
{
class UnaryOperatorType {
public:
using op_type = T;
static constexpr ngraph::element::Type_t element_type = ELEMENT_TYPE;
};
template <typename T>
class UnaryOperatorVisitor : public testing::Test
{
};
class UnaryOperatorVisitor : public testing::Test {};
class UnaryOperatorTypeName
{
class UnaryOperatorTypeName {
public:
template <typename T>
static std::string GetName(int)
{
static std::string GetName(int) {
using OP_Type = typename T::op_type;
constexpr ngraph::element::Type precision(T::element_type);
const ngraph::Node::type_info_t typeinfo = OP_Type::get_type_info_static();
@@ -34,8 +29,7 @@ public:
TYPED_TEST_SUITE_P(UnaryOperatorVisitor);
TYPED_TEST_P(UnaryOperatorVisitor, No_Attribute_4D)
{
TYPED_TEST_P(UnaryOperatorVisitor, No_Attribute_4D) {
using OP_Type = typename TypeParam::op_type;
const ngraph::element::Type_t element_type = TypeParam::element_type;