Quantizes updates along the quantAxis axis: quantScales scales updates, and quantZeroPoints offsets updates. Then, the values in the quantized updates are updated one by one at the corresponding positions in selfRef based on the index tensor indices along the specified axis.
Each operator has calls. First, aclnnInplaceQuantScatterGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnInplaceQuantScatter is called to perform computation.
[object Object][object Object]
Parameters:
- selfRef (aclTensor*, compute input | compute output): tensor on the device, source data tensor. The data type can be INT8. The tensor supports three to eight dimensions. The can be ND. are supported.
- [object Object]Atlas inference series products[object Object], [object Object]Atlas A2 training products/Atlas A2 inference products[object Object], and [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]: The size of the last dimension must be 32-byte aligned.
- indices (aclTensor*, compute input): tensor on the device, index tensor. The data type can be INT32 or INT64. Only one or two dimensions are supported. The can be ND. are supported.
When the shape of indices is one-dimensional, the value range of indices is [0, selfRef.shape(axis) - updates.shape(axis));
When the shape of indices is two-dimensional, the value range of the 0th data of each item in indices is [0, selfRef.shape(0)), and the value range of the first data of each item in indices is [0, selfRef.shape(axis) - updates.shape(axis)). - updates (aclTensor*, compute input): tensor on the device, update data tensor. The number of dimensions of updates must be the same as that of selfRef. The size of the first dimension of updates is equal to that of the first dimension of indices and is not greater than that of the first dimension of selfRef. The size of the axis is not greater than that of the axis of selfRef. The size of other dimensions must be the same as that of the corresponding dimensions of selfRef. The can be ND. are supported.
- [object Object]Atlas inference series products[object Object]: The data type can be FLOAT16. The size of the last dimension must be 32-byte aligned.
- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]: The data type can be BFLOAT16 or FLOAT16. The size of the last dimension must be 32-byte aligned.
- quantScales (aclTensor*, compute input): tensor on the device, quantization scaling tensor. The tensor supports one to eight dimensions. The number of elements in quantScales must be equal to the size of updates on the quantAxis axis. are supported, and the supports ND.
- [object Object]Atlas inference series products[object Object]: The data type can be FLOAT32.
- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]: The data type can be BFLOAT16 or FLOAT32.
- quantZeroPoints (aclTensor*, compute input): tensor on the device, quantization offset tensor. The tensor supports one to eight dimensions. The number of elements in quantZeroPoints must be equal to the size of updates on the quantAxis axis. are supported. The supports ND. This parameter is optional.
- [object Object]Atlas inference series products[object Object]: The data type can be INT32.
- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]: The data type can be BFLOAT16 or INT32.
- axis (int64_t, compute input): axis to be updated on updates. The data type is INT64. The value range is [-len(updates.shape) + 1, -1) or [1, len(updates.shape) - 1).
- quantAxis (int64_t, compute input): axis to be quantized on updates. The data type is INT64. The value can be -1 or len(updates.shape) - 1.
- reduction (int64_t, compute input): data operation mode. The data type is INT64. The value can be 1 (update).
- workspaceSize (uint64_t *, output): size of the workspace to be allocated on the device.
- executor (aclOpExecutor **, output): operator executor, containing the operator computation process.
- selfRef (aclTensor*, compute input | compute output): tensor on the device, source data tensor. The data type can be INT8. The tensor supports three to eight dimensions. The can be ND. are supported.
Returns:
Parameters:
- workspace (void*, input): address of the workspace to be allocated on the device.
- workspaceSize (uint64_t, input): size of the workspace to be allocated on the device, which is obtained by the first-phase API aclnnInplaceQuantScatterGetWorkspaceSize.
- executor (aclOpExecutor *, input): operator executor, containing the operator computation process.
- stream (aclrtStream, input): stream for executing the task.
Returns:
Deterministic compute:
- aclnnInplaceQuantScatter defaults to a deterministic implementation.
indices can only be one- or two-dimensional. If it is two-dimensional, the size of the second dimension must be 2. Index out-of-bounds is not supported or verified. The selfRef data segments mapped by indices cannot overlap. If they overlap, the execution results may be different due to multi-core concurrency.
The input combinations of the data types of selfRef, indices, updates, quantScales, and quantZeroPoints are as follows:
[object Object]Atlas inference series products[object Object]:
[object Object]undefined
[object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]:
[object Object]undefined
The following example is for reference only. For details, see .