SetFixPipeClipRelu
Supported Products
Product |
Supported (√/x) |
|---|---|
x |
|
x |
|
√ |
|
x |
|
x |
|
x |
Function Usage
Sets the maximum value of the ClipReLU operation after real-time quantization is performed during DataCopy (CO1 -> GM).
ClipReLU is calculated as follows: min (clipReluMaxVal, srcData). clipReluMaxVal is the maximum value set by calling this API, and srcData is the source data.
Prototype
1 | __aicore__ inline void SetFixPipeClipRelu(uint64_t config) |
Parameters
Parameter |
Input/Output |
Meaning |
|---|---|---|
config |
Input |
clipReluMaxVal, which is the maximum value of the ClipReLU operation. clipReluMaxVal occupies only 0-15 bits. It must be greater than 0 and cannot be INF/NAN. |
Restrictions
When ReLU is enabled, the ReLU operation is performed before the ClipReLU operation.
Returns
None
Example
For details, see the complete example.
1 2 | uint64_t clipReluMaxVal = 0x3c00; // value 1, convert half type to uint64_t type SetFixPipeClipRelu(clipReluMaxVal); |