Output
Function
In some scenarios, an operator supports different prototype outputs on different AI Processor models.
This API can register differentiated operator outputs for different AI Processor models. After this API is called, an OpParamDef structure is returned. You can use this structure to configure operator outputs.
Prototype
1 | OpParamDef &Output(const char *name) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
name |
Input |
Operator output name. |
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 | class AddCustom : public OpDef { public: AddCustom(const char* name) : OpDef(name) { this->Input("x").DataType({ ge::DT_FLOAT16 }).ParamType(OPTIONAL); this->Output("y").DataType({ ge::DT_FLOAT16 }); OpAICoreConfig aicConfig1; OpAICoreConfig aicConfig2; aicConfig1.Output("y") .ParamType(OPTIONAL) .DataType({ ge::DT_FLOAT }) .Format({ ge::FORMAT_ND }); aicConfig2.Output("y") .ParamType(REQUIRED) .DataType({ ge::DT_INT32 }) .Format({ ge::FORMAT_ND }); this->AICore().AddConfig("ascendxxx1", aicConfig1); this->AICore().AddConfig("ascendxxx2", aicConfig2); } }; |
Parent topic: OpAICoreConfig