Skip to content

Commit 8cb494f

Browse files
committed
add blocks attr type in proto
1 parent aa84b21 commit 8cb494f

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

paddle/fluid/framework/framework.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ enum AttrType {
2727
BOOLEANS = 7;
2828
BLOCK = 8;
2929
LONG = 9;
30+
BLOCKS = 10;
3031
}
3132

3233
// OpDesc describes an instance of a C++ framework::OperatorBase

paddle/fluid/operators/listen_and_serv_op.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,8 @@ class ListenAndServOpMaker : public framework::OpProtoAndCheckerMaker {
342342
.SetDefault({});
343343
AddAttr<bool>("sync_mode", "if works at sync_mode or not").SetDefault(true);
344344
AddAttr<std::vector<framework::BlockDesc *>>(
345-
kOptimizeBlocks, "Optimize blocks to run on server side.");
345+
kOptimizeBlocks, "Optimize blocks to run on server side.")
346+
.SetDefault({});
346347
AddAttr<std::vector<std::string>>(kPrefetchVarNameToBlockId,
347348
"prefetch blocks to run on server side.")
348349
.SetDefault({});

paddle/fluid/pybind/protobuf.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,8 @@ void BindOpDesc(pybind11::module *m) {
268268
.value("STRINGS", pd::proto::AttrType::STRINGS)
269269
.value("BOOL", pd::proto::AttrType::BOOLEAN)
270270
.value("BOOLS", pd::proto::AttrType::BOOLEANS)
271-
.value("BLOCK", pd::proto::AttrType::BLOCK);
271+
.value("BLOCK", pd::proto::AttrType::BLOCK)
272+
.value("BLOCKS", pd::proto::AttrType::BLOCKS);
272273

273274
pybind11::class_<pd::OpDesc> op_desc(*m, "OpDesc", "");
274275
op_desc

0 commit comments

Comments
 (0)