Comment

Function Usage

Sets the comment of the input or output parameter. Generates operator prototype comments when the operator prototype header file is automatically generated.

Based on the operator prototype definition, the custom operator project can automatically generate the operator prototype definition REG_OP that is used in the graph mode. You can use the generated operator prototype to perform operations such as graph construction, build, and execution.

The generated comments help understand the operator prototype and can be used to automatically generate the operator prototype documentation. Generally, built-in CANN operators are widely used. Developers can use them as required.

Prototype

1
OpParamDef &Comment(const char *comment)

Parameters

Parameter

Input/Output

Description

comment

Input

Comment content.

Returns

Operator parameter definition. For details about OpParamDef, see OpParamDef.

Constraints

None

Examples

 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
class AddCustom : public OpDef {
public:
    explicit AddCustom(const char* name) : OpDef(name)
    {
        this->Input("x")
            .ParamType(REQUIRED)
            .DataType({ge::DT_FLOAT, ge::DT_INT32})
            .FormatList({ge::FORMAT_ND})
		.Comment("Input cmt 1"); // Comment content
        this->Input("y")
            .ParamType(REQUIRED)
		.Comment("Input cmt 2") // Comment content
            .DataType({ge::DT_FLOAT, ge::DT_INT32})
            .FormatList({ge::FORMAT_ND});

        this->Output("z")
		.Comment("Output cmt 1") // Comment content
            .ParamType(REQUIRED)
            .DataType({ge::DT_FLOAT, ge::DT_INT32})
            .FormatList({ge::FORMAT_ND});

        this->SetInferShape(ge::InferShape).SetInferDataType(ge::InferDataType);

        this->AICore()
            .SetTiling(optiling::TilingFunc);
        this->AICore().AddConfig("ascendxxx");

    }
};