SetFixPipeClipRelu
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
x |
x |
|
x |
|
√ |
|
x |
|
x |
|
x |
Function Usage
Sets the maximum value of the ClipReLU operation after the real-time quantization 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 |
Description |
|---|---|---|
config |
Input |
clipReluMaxVal, which is the maximum value of the ClipReLU operation. clipReluMaxVal occupies only 0 to 15 bits. It must be greater than 0 and cannot be INF or NAN. |
Restrictions
When ReLU is enabled, the ReLU operation is performed before the ClipReLU operation.
Returns
None
Examples
For details about the complete example, see Complete Example.
1 2 | uint64_t clipReluMaxVal = 0x3c00; SetFixPipeClipRelu(clipReluMaxVal); // When ReLU is enabled, the ReLU operation is performed first, then clipping. clipReluMaxVal is the maximum value set through this API. |