set_device_sat_mode
Applicability
Product |
Supported |
|---|---|
√ |
|
√ |
|
☓ |
|
☓ |
|
√ |
Description
Sets the process-level overflow/underflow mode for floating-point computation.
- Saturation mode: When overflow/underflow occurs during computing, the compute result is saturated as the floating-point extremum (±MAX).
- Inf/NaN mode: Complies with IEEE 754 and outputs the Inf/NaN compute result based on the definition.
For the
For the
For the
Prototype
1 | def set_device_sat_mode(mode) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
mode |
Input |
Specified overflow mode.
For the For the For the |
Returns
None
Restrictions
This API needs to be configured during running and called before the network script is executed.
Example
The following example applies only to the
1 2 3 4 5 6 7 | import tensorflow as tf from npu_bridge.npu_init import * ...... # The following API is called to set the overflow/underflow mode during network execution: npu_plugin.set_device_sat_mode(1) sess.run(xxx) |