[object Object][object Object][object Object]undefined
[object Object]
  • API function:
    • When fake_quant_enabled is greater than or equal to 1: Performs fake quantization on the input self with scale and zero_point, limits the value range of the fake-quantized output by quant_min and quant_max, and finally returns the output out as well as the corresponding position mask mask.
    • When fake_quant_enabled is less than 1: Returns out as a clone of self, and mask with all values set to True.
  • Formula: When fake_quant_enabled is greater than or equal to 1, computes the temporary variable qval, then calculates out and mask.qval=Round(std::nearby_int(self/scale)+zero_point)qval = Round(std::nearby\_int(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, aclnnFakeQuantPerTensorAffineCachemaskGetWorkspaceSize is called to obtain the input parameters and compute the required workspace size based on the process. Then, aclnnFakeQuantPerTensorAffineCachemask 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 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 computation:
    • aclnnFakeQuantPerTensorAffineCachemask defaults to a deterministic implementation.
[object Object]

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

[object Object]