|
|
@ -27,10 +27,11 @@ limitations under the License. */
|
|
|
|
namespace paddle {
|
|
|
|
namespace paddle {
|
|
|
|
namespace framework {
|
|
|
|
namespace framework {
|
|
|
|
|
|
|
|
|
|
|
|
typedef boost::variant<boost::blank, bool, int, float, std::string,
|
|
|
|
// The order should be as same as framework.proto
|
|
|
|
std::vector<bool>, std::vector<int>, std::vector<float>,
|
|
|
|
typedef boost::variant<boost::blank, int, float, std::string, std::vector<int>,
|
|
|
|
std::vector<std::string>,
|
|
|
|
std::vector<float>, std::vector<std::string>,
|
|
|
|
std::vector<std::pair<int, int>>, BlockDesc*>
|
|
|
|
std::vector<std::pair<int, int>>, bool,
|
|
|
|
|
|
|
|
std::vector<bool>, BlockDesc*>
|
|
|
|
Attribute;
|
|
|
|
Attribute;
|
|
|
|
|
|
|
|
|
|
|
|
typedef std::unordered_map<std::string, Attribute> AttributeMap;
|
|
|
|
typedef std::unordered_map<std::string, Attribute> AttributeMap;
|
|
|
@ -38,7 +39,10 @@ typedef std::unordered_map<std::string, Attribute> AttributeMap;
|
|
|
|
ProgramDesc& GetProgramDesc();
|
|
|
|
ProgramDesc& GetProgramDesc();
|
|
|
|
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
template <typename T>
|
|
|
|
AttrType AttrTypeID();
|
|
|
|
inline AttrType AttrTypeID() {
|
|
|
|
|
|
|
|
Attribute tmp = T();
|
|
|
|
|
|
|
|
return static_cast<AttrType>(tmp.which() - 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Attribute GetAttrValue(const OpDesc::Attr& attr_desc);
|
|
|
|
Attribute GetAttrValue(const OpDesc::Attr& attr_desc);
|
|
|
|
|
|
|
|
|
|
|
|