[object Object][object Object][object Object]undefined
[object Object]
  • Function: Fake-quantizes the input data self on the specified axis using scale and zero_point, updates the value range of the fake-quantized output based on quant_min and quant_max, and returns the result out and the corresponding position mask.

  • Formula: Computes the temporary variable qval, then calculates out and mask.

    • The data type of zero_point is int32.qval=Round(std::nearby_int(self/scale)+zero_point)qval = Round(std::nearby\_int(self / scale) + zero\_point)
    • The data type of zero_point is float16 or float32.qval=std::lrintf(self/scale+zero_point)qval = std::lrintf(self / scale + zero\_point)
    out=(Min(quant_max,Max(quant_min,qval))zero_point)scaleout = (Min(quant\_max, Max(quant\_min, qval)) - zero\_point) * scale mask=(qval>=quant_min)&(qval<=quant_max)mask = (qval >= quant\_min) \& (qval <= quant\_max)
[object Object]

Each operator has calls. First, aclnnFakeQuantPerChannelAffineCachemaskGetWorkspaceSize is called to obtain the input parameters and compute the required workspace size based on the process. Then, aclnnFakeQuantPerChannelAffineCachemask is called to perform computation.

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

    [object Object]
  • Returns

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

    The first-phase API implements input parameter validation. The following error codes may be returned.

    [object Object]
[object Object]
  • Parameters

    [object Object]
  • Returns

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

[object Object]
  • Deterministic computation:

    • aclnnFakeQuantPerChannelAffineCachemask defaults to a deterministic implementation.
  • The current operator FakeQuantPerChannelAffineCachemask does not yet support FLOAT32 or FLOAT16 inputs for zero_point. This constraint is currently enforced at the aclnn API level and will be lifted once the operator natively supports these data types.

[object Object]

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

[object Object]