Comment
函数功能
设置算子分组信息以及算子原型注释,包括算子简述,算子约束等内容。用于在自动生成算子原型头文件时,同步生成算子原型注释。
函数原型
1
|
OpDef &Comment(CommentSection section, const char *comment) |
参数说明
参数 |
输入/输出 |
说明 |
---|---|---|
section |
输入 |
通过CommentSection类去指定该接口的功能,支持以下几种取值:
|
comment |
输入 |
增加comment注释。 |
返回值说明
OpDef算子定义,OpDef请参考OpDef。
调用示例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
AddCustomComment(const char* name) : OpDef(name) { this->Comment(CommentSection::CATEGORY, "catg"); // 算子分组 this->Comment(CommentSection::BRIEF, "Brief cmt") // BRIEF注释 .Comment(CommentSection::CONSTRAINTS, "Constraints cmt 1") // CONSTRAINTS注释 .Comment(CommentSection::CONSTRAINTS, "Constraints cmt 2"); this->Comment(CommentSection::RESTRICTIONS, "Restrictions cmt") // RESTRICTIONS注释 .Comment(CommentSection::RESTRICTIONS, "Restrictions cmt") .Comment(CommentSection::THIRDPARTYFWKCOMPAT, "ThirdParnyFwkCopat cmt") // THIRDPARTYFWKCOMPAT注释 .Comment(CommentSection::THIRDPARTYFWKCOMPAT, "ThirdPartyFwkCopat cmt") .Comment(CommentSection::SEE, "See cmt")// SEE注释 .Comment(CommentSection::SEE, "Seen cmt"); this->Input("x") .ParamType(REQUIRED) .DataType({ge::DT_FLOAT, ge::DT_INT32}) .FormatList({ge::FORMAT_ND}); this->Input("y") .ParamType(REQUIRED) .DataType({ge::DT_FLOAT, ge::DT_INT32}) .FormatList({ge::FORMAT_ND}); this->Output("z") .ParamType(REQUIRED) .DataType({ge::DT_FLOAT, ge::DT_INT32}) .FormatList({ge::FORMAT_ND}); this->AICore() .SetTiling(optiling::TilingFunc); this->AICore().AddConfig("ascendxxx"); } |
父主题: OpDef