From f4832fe0b477606be8434b4070abe8b6e38b2aa4 Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Mon, 25 Sep 2017 11:46:43 -0700 Subject: [PATCH] Remove IntPair type in attribute --- paddle/framework/attribute.cc | 8 -------- paddle/framework/attribute.h | 3 +-- paddle/framework/framework.proto | 13 +++---------- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/paddle/framework/attribute.cc b/paddle/framework/attribute.cc index e705da0131..510dc28c57 100644 --- a/paddle/framework/attribute.cc +++ b/paddle/framework/attribute.cc @@ -70,14 +70,6 @@ Attribute GetAttrValue(const OpDesc::Attr& attr_desc) { } return val; } - case framework::AttrType::INT_PAIRS: { - std::vector> val(attr_desc.int_pairs_size()); - for (int i = 0; i < attr_desc.int_pairs_size(); ++i) { - val[i].first = attr_desc.int_pairs(i).first(); - val[i].second = attr_desc.int_pairs(i).second(); - } - return val; - } case framework::AttrType::BLOCK: { return GetProgramDesc().mutable_blocks(attr_desc.block_idx()); } diff --git a/paddle/framework/attribute.h b/paddle/framework/attribute.h index 13f2877226..488fa38faf 100644 --- a/paddle/framework/attribute.h +++ b/paddle/framework/attribute.h @@ -29,8 +29,7 @@ namespace framework { // The order should be as same as framework.proto typedef boost::variant, - std::vector, std::vector, - std::vector>, bool, + std::vector, std::vector, bool, std::vector, BlockDesc*> Attribute; diff --git a/paddle/framework/framework.proto b/paddle/framework/framework.proto index 6fcfe6de25..951c7afbc1 100644 --- a/paddle/framework/framework.proto +++ b/paddle/framework/framework.proto @@ -22,17 +22,11 @@ enum AttrType { INTS = 3; FLOATS = 4; STRINGS = 5; - INT_PAIRS = 6; - BOOLEAN = 7; - BOOLEANS = 8; - BLOCK = 9; + BOOLEAN = 6; + BOOLEANS = 7; + BLOCK = 8; } -message IntPair { - required int32 first = 1; - required int32 second = 2; -}; - // OpDesc describes an instance of a C++ framework::OperatorBase // derived class type. message OpDesc { @@ -46,7 +40,6 @@ message OpDesc { repeated int32 ints = 6; repeated float floats = 7; repeated string strings = 8; - repeated IntPair int_pairs = 9; optional bool b = 10; repeated bool bools = 11; optional int32 block_idx = 12; -- GitLab