This API is used to fuse GeluV2 with DynamicQuant/AscendQuantV2. It performs Gelu activation on the input data self, quantizes the activation result, and outputs the quantized result.
Formula:
- Calculate the Gelu value to obtain geluOut.
- approximate = tanh
- approximate = none
- Quantize geluOut.
- quant_mode = static
quant_mode = dynamic
maxValue: maximum value of the corresponding data type.
[object Object]undefined
Each operator has calls. You must call aclnnGeluQuantGetWorkspaceSize to obtain the workspace size required for computation and the executor that contains the operator computation process, and then call aclnnGeluQuant to perform the computation.
Parameters
[object Object]Returns
[object Object]: status code. For details, see .
The first-phase API implements input parameter validation. The following error codes may be returned.
[object Object]Deterministic computation:
- The aclnnGeluQuant is implemented in deterministic mode by default.
The data type of inputScaleOptional is the same as that of self. If the types are different, the type with higher precision is used.
The following example is for reference only. For details, see .