- 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.
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]
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]
- Deterministic computation:
- aclnnFakeQuantPerTensorAffineCachemask defaults to a deterministic implementation.
The following example is for reference only. For details, see .
[object Object]