Add HasAttr method to Operator

panyx0718-patch-1
Michal Gallus 7 years ago
parent 700bcbf74f
commit 4e54ab76ec

@ -100,6 +100,7 @@ class OperatorBase {
const std::string& Type() const { return type_; }
bool HasAttr(const std::string& name) const { return attrs_.count(name); }
template <typename T>
inline const T& Attr(const std::string& name) const {
PADDLE_ENFORCE(attrs_.count(name) != 0, "%s should be in AttributeMap",

Loading…
Cancel
Save