[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Quantizes the input x. The axes of scale and offset can be set by using axis. The shapes of scale and offset must be the same as axes of x specified by axis or equal to 1.
  • Formula:
    • When sqrtMode is false, the calculation formula is as follows:

      y=round((xscale)+offset)y = round((x * scale) + offset)
    • When sqrtMode is true, the calculation formula is as follows:

      y=round((xscalescale)+offset)y = round((x * scale * scale) + offset)
[object Object]

Each operator has calls. First, aclnnAscendQuantV3GetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnAscendQuantV3 is called to perform computation.

[object Object]
[object Object]
[object Object]
  • Parameters:

    [object Object]
    • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]:

      • When the data format of [object Object], [object Object], and [object Object] is NZ, the data type can only be FLOAT32.
      • The data type of the output parameter [object Object] can only be INT8, INT32, or INT4. When the data format is NZ, the data type can be INT32.
      • The input parameter [object Object] can be set to round, ceil, trunc, or floor. When the data format of the input [object Object] is NZ, the value can be round.
      • The input parameter [object Object] can be set to 2, 3, or 29, indicating INT8, INT32, or INT4, respectively. When the data format of input [object Object] is NZ, the value can be 3, indicating INT32.
      • The input parameter [object Object] can only specify the last two dimensions of x. (Assume that the dimension of input x is xDimNum. The value range of axis is [–2, –1] or [xDimNum–2, xDimNum–1].)
    • Ascend 950PR/Ascend 950DT:

      • The data format of the [object Object], [object Object] and [object Object] parameters does not support NZ.
      • Input parameter [object Object]: If [object Object] is FLOAT8_E5M2 or FLOAT8_E4M3FN, only round is supported. If [object Object] is HIFLOAT8, round and hybrid are supported. When [object Object] indicates other types, round, ceil, trunc, and floor are supported.
      • The input parameter [object Object] can only specify the last two dimensions of x. (Assume that the dimension of input x is xDimNum. The value range of axis is [–2, –1] or [xDimNum–2, xDimNum–1].)
    • [object Object]Atlas inference products[object Object]:

      • The data types of the input parameters [object Object], [object Object], and [object Object] do not support BFLOAT16, and the data format cannot be NZ.
      • The data type of the output parameter [object Object] can only be INT8, and the data format cannot be NZ.
      • The input parameter [object Object] can be set to round, ceil, trunc, or floor.
      • The input parameter [object Object] can only be set to 2, indicating INT8.
      • The input parameter [object Object] can only specify the last dimension of x. (Assume that the dimension of input x is xDimNum. The value of axis is –1 or xDimNum–1.)
  • Returns:

    [object Object]: status code. For details, see .

    The first-phase API implements input parameter verification. The following errors may be thrown.

    [object Object]
[object Object]
  • Parameters:

    [object Object]
  • Returns:

    [object Object]: status code. For details, see .

[object Object]
  • Deterministic compute:
    • aclnnAscendQuantV3 defaults to a deterministic implementation.
[object Object]

The following example is for reference only. For details, see .

[object Object]