Class OpDesc

Inheritance Relationships

Base Type

Class Documentation

class cinn::frontend::paddle::cpp::OpDesc : public cinn::frontend::paddle::cpp::OpDescAPI

Public Types

using attrs_t = std::map<std::string, absl::any>
using attr_types_t = std::map<std::string, AttrType>

Public Functions

OpDesc() = default
std::string Type() const override

Get operator’s type.

void SetType(const std::string &x) override

Set operator’s type.

const std::map<std::string, std::vector<std::string>> &inputs() const
const std::map<std::string, std::vector<std::string>> &outputs() const
std::map<std::string, std::vector<std::string>> *mutable_inputs()
std::map<std::string, std::vector<std::string>> *mutable_outputs()
bool HasInput(const std::string &param) const
std::vector<std::string> Input(const std::string &param) const override

Get arguments given the parameter.

std::vector<std::string> InputArgumentNames() const override

Get parameters.

std::vector<std::string> OutputArgumentNames() const override

Get parameters.

std::vector<std::string> input_vars() const
std::vector<std::string> output_vars() const
bool HasOutput(const std::string &param) const
std::vector<std::string> Output(const std::string &param) const override

Get arguments given the parameter.

void SetInput(const std::string &param, const std::vector<std::string> &args) override

Set a input given the parameter and arguments.

void SetOutput(const std::string &param, const std::vector<std::string> &args) override
bool HasAttr(const std::string &name) const override

Tell whether this desc has an attribute.

AttrType GetAttrType(const std::string &name) const override

Get the type of an attribute.

std::vector<std::string> AttrNames() const override
template<typename T>
void SetAttr(const std::string &name, const T &v)
template<typename T>
T GetAttr(const std::string &name) const
const std::map<std::string, absl::any> &attrs() const
const std::map<std::string, AttrType> &attr_types() const
template<>
void SetAttr(const std::string &name, const int32_t &v)
template<>
void SetAttr(const std::string &name, const float &v)
template<>
void SetAttr(const std::string &name, const bool &v)
template<>
void SetAttr(const std::string &name, const int64_t &v)
template<>
int32_t GetAttr(const std::string &name) const
template<>
float GetAttr(const std::string &name) const
template<>
int64_t GetAttr(const std::string &name) const
template<>
bool GetAttr(const std::string &name) const

Protected Attributes

std::string type_
std::map<std::string, std::vector<std::string>> inputs_
std::map<std::string, std::vector<std::string>> outputs_
std::map<std::string, absl::any> attrs_
std::map<std::string, AttrType> attr_types_