set_device_sat_mode

Description

Sets the process-level overflow mode for floating-point computation.

  • Saturation mode: When overflow occurs during compute, 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 Atlas Training Series Product, the default (and the only supported) mode is saturation mode.

Prototype

def set_device_sat_mode(mode)

Options

Option

Input/Output

Description

mode

Input

Specified overflow mode.

  • 0: saturation mode.
  • 1: Inf-NaN mode.

For the Atlas Training Series Product, the default (and the only supported) value is 0.

Returns

None

Restrictions

This API needs to be configured during running and called before the network script is executed.