From 5842afa61f66ed00838498c8c3471022946c879d Mon Sep 17 00:00:00 2001 From: y00500818 Date: Mon, 21 Dec 2020 20:17:27 +0800 Subject: [PATCH] add dt_variant type. --- ge/client/proto/ge_ir.proto | 1 + ge/common/ge/datatype_util.cc | 1 + ge/common/proto/ge_ir.proto | 1 + ge/executor/proto/dump_task.proto | 1 + ge/executor/proto/ge_ir.proto | 1 + ge/graph/load/new_model_manager/data_dumper.cc | 1 + ge/offline/proto/ge_ir.proto | 1 + ge/proto/dump_task.proto | 1 + ge/proto/ge_ir.proto | 1 + metadef | 2 +- parser | 2 +- tests/ut/ge/common/format_transfer_unittest.cc | 2 +- 12 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ge/client/proto/ge_ir.proto b/ge/client/proto/ge_ir.proto index e7bfe0cb..12989a54 100644 --- a/ge/client/proto/ge_ir.proto +++ b/ge/client/proto/ge_ir.proto @@ -30,6 +30,7 @@ enum DataType DT_RESOURCE = 23; // resource type DT_STRING_REF = 24; // string_ref type DT_DUAL = 25; /**< dual output type */ + DT_VARIANT = 26; // variant type } message AttrDef diff --git a/ge/common/ge/datatype_util.cc b/ge/common/ge/datatype_util.cc index 15234768..c051fe1d 100755 --- a/ge/common/ge/datatype_util.cc +++ b/ge/common/ge/datatype_util.cc @@ -62,6 +62,7 @@ std::map g_dump_data_type_map = { {ge::DT_RESOURCE, ge::proto::DT_RESOURCE}, {ge::DT_STRING_REF, ge::proto::DT_STRING_REF}, {ge::DT_STRING, ge::proto::DT_STRING}, + {ge::DT_VARIANT, ge::proto::DT_VARIANT}, }; } // namespace diff --git a/ge/common/proto/ge_ir.proto b/ge/common/proto/ge_ir.proto index e7bfe0cb..12989a54 100644 --- a/ge/common/proto/ge_ir.proto +++ b/ge/common/proto/ge_ir.proto @@ -30,6 +30,7 @@ enum DataType DT_RESOURCE = 23; // resource type DT_STRING_REF = 24; // string_ref type DT_DUAL = 25; /**< dual output type */ + DT_VARIANT = 26; // variant type } message AttrDef diff --git a/ge/executor/proto/dump_task.proto b/ge/executor/proto/dump_task.proto index b1e346cd..c2e4a0b8 100644 --- a/ge/executor/proto/dump_task.proto +++ b/ge/executor/proto/dump_task.proto @@ -28,6 +28,7 @@ enum OutputDataType { DT_RESOURCE = 23; DT_STRING_REF = 24; DT_DUAL = 25; + DT_VARIANT = 26; } enum OutputFormat { diff --git a/ge/executor/proto/ge_ir.proto b/ge/executor/proto/ge_ir.proto index e7bfe0cb..12989a54 100644 --- a/ge/executor/proto/ge_ir.proto +++ b/ge/executor/proto/ge_ir.proto @@ -30,6 +30,7 @@ enum DataType DT_RESOURCE = 23; // resource type DT_STRING_REF = 24; // string_ref type DT_DUAL = 25; /**< dual output type */ + DT_VARIANT = 26; // variant type } message AttrDef diff --git a/ge/graph/load/new_model_manager/data_dumper.cc b/ge/graph/load/new_model_manager/data_dumper.cc index 6f65e907..b33a062d 100644 --- a/ge/graph/load/new_model_manager/data_dumper.cc +++ b/ge/graph/load/new_model_manager/data_dumper.cc @@ -120,6 +120,7 @@ static int32_t GetIrDataType(ge::DataType data_type) { {ge::DT_RESOURCE, ge::proto::DT_RESOURCE}, {ge::DT_STRING_REF, ge::proto::DT_STRING_REF}, {ge::DT_STRING, ge::proto::DT_STRING}, + {ge::DT_VARIANT, ge::proto::DT_VARIANT}, }; auto iter = data_type_map.find(data_type); diff --git a/ge/offline/proto/ge_ir.proto b/ge/offline/proto/ge_ir.proto index e7bfe0cb..12989a54 100644 --- a/ge/offline/proto/ge_ir.proto +++ b/ge/offline/proto/ge_ir.proto @@ -30,6 +30,7 @@ enum DataType DT_RESOURCE = 23; // resource type DT_STRING_REF = 24; // string_ref type DT_DUAL = 25; /**< dual output type */ + DT_VARIANT = 26; // variant type } message AttrDef diff --git a/ge/proto/dump_task.proto b/ge/proto/dump_task.proto index b1e346cd..c2e4a0b8 100644 --- a/ge/proto/dump_task.proto +++ b/ge/proto/dump_task.proto @@ -28,6 +28,7 @@ enum OutputDataType { DT_RESOURCE = 23; DT_STRING_REF = 24; DT_DUAL = 25; + DT_VARIANT = 26; } enum OutputFormat { diff --git a/ge/proto/ge_ir.proto b/ge/proto/ge_ir.proto index e7bfe0cb..12989a54 100644 --- a/ge/proto/ge_ir.proto +++ b/ge/proto/ge_ir.proto @@ -30,6 +30,7 @@ enum DataType DT_RESOURCE = 23; // resource type DT_STRING_REF = 24; // string_ref type DT_DUAL = 25; /**< dual output type */ + DT_VARIANT = 26; // variant type } message AttrDef diff --git a/metadef b/metadef index 8c89c521..c14d2be3 160000 --- a/metadef +++ b/metadef @@ -1 +1 @@ -Subproject commit 8c89c521f5d682327b2f975cf06f7093960eb2f0 +Subproject commit c14d2be38171eed63416e71178774103faf1f5cd diff --git a/parser b/parser index 54ec7731..34559943 160000 --- a/parser +++ b/parser @@ -1 +1 @@ -Subproject commit 54ec7731e3a2951191693e02ff3165220975ed0c +Subproject commit 34559943b6cb645042a87d99bc88ead016b15b64 diff --git a/tests/ut/ge/common/format_transfer_unittest.cc b/tests/ut/ge/common/format_transfer_unittest.cc index 4fcfb378..fd2a296c 100644 --- a/tests/ut/ge/common/format_transfer_unittest.cc +++ b/tests/ut/ge/common/format_transfer_unittest.cc @@ -79,7 +79,7 @@ TEST_F(UtestFormatTransfer, get_size_by_data_type) { EXPECT_EQ(GetSizeByDataType(DT_STRING_REF), -1); EXPECT_EQ(GetSizeByDataType(DT_DUAL), 5); EXPECT_EQ(GetSizeByDataType(DT_UNDEFINED), -1); - EXPECT_EQ(DT_UNDEFINED, 26); + EXPECT_EQ(DT_UNDEFINED, 27); } } // namespace formats } // namespace ge