diff --git a/paddle/framework/operator.h b/paddle/framework/operator.h index 50fc6d10134e26043c73e32e90b97cd7d40f01d2..f5d167a16ec577f6989593122715ac5681d11eda 100644 --- a/paddle/framework/operator.h +++ b/paddle/framework/operator.h @@ -95,16 +95,21 @@ class OperatorBase { //! Get a input with argument's name described in `op_proto` const std::string& Input(const std::string& name) const; - //! Get a input which has multiple variables. //! TODO add a vector_view to prevent memory copy. std::vector Inputs(const std::string& name) const; + //! Get a output with argument's name described in `op_proto` const std::string& Output(const std::string& name) const; //! Get an output which has multiple variables. //! TODO add a vector_view to prevent memory copy. std::vector Outputs(const std::string& name) const; + const std::string Type() const { return type_; } + const std::vector Inputs() const { return inputs_; } + const std::vector Outputs() const { return outputs_; } + const AttributeMap& Attrs() const { return attrs_; } + public: std::string type_; // NOTE: in case of OpGrad, inputs_ contains: