Skip to content

Commit

Permalink
Merge pull request #4990 from tonyyang-svail/add_optional_in_op_proto
Browse files Browse the repository at this point in the history
add optional in op proto
  • Loading branch information
Yang Yang(Tony) authored Oct 21, 2017
2 parents ac4f759 + c030589 commit fa05094
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions paddle/framework/framework.proto
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ message OpProto {

optional bool duplicable = 3 [ default = false ];
optional bool intermediate = 4 [ default = false ];
optional bool dispensable = 5 [ default = false ];
}

// AttrProto describes the C++ type Attribute.
Expand Down
5 changes: 5 additions & 0 deletions paddle/framework/op_proto_maker.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ class OpProtoAndCheckerMaker {
var_->set_intermediate(true);
return *this;
}

VariableBuilder& AsDispensable() {
var_->set_dispensable(true);
return *this;
}
};

VariableBuilder AddInput(const std::string& name, const std::string& comment);
Expand Down

0 comments on commit fa05094

Please sign in to comment.