- Description: Implements the backpropagation of the grouped bias addition (
[object Object]). The extended API of this API is . - Formula:[object Object]
(1) If
[object Object]is available:
[object Object] has two dimensions. [object Object] indicates the size of the last dimension of [object Object], while [object Object] indicates the size of dimension 0 of [object Object]. That is, [object Object] has [object Object] numbers, and [object Object] indicates the size of the jth dimension. After computation, [object Object] is 2-dimensional, with the shape [object Object].[object Object]
(2) If [object Object] is unavailable:
[object Object] has three dimensions. [object Object], [object Object], and [object Object] indicate the sizes of dimensions 0 to 2 of [object Object]. After computation, [object Object] is 2-dimensional, with the shape [object Object].
- Example:[object Object]
(1) If
[object Object]is available:[object Object] The shape of[object Object]is (1000, 30), and the shape of[object Object]is (400, 600, 1000).[object Object]is divided into three groups, and the accumulated number of rows in each group is 400, 200, and 400 respectively. After computation, the shape of[object Object]is (3, 30).[object Object] (2) If[object Object]is unavailable:[object Object] The shape of[object Object]is (10, 100, 30).[object Object]is divided into 10 groups. The accumulated number of rows in each group is 100. After computation, the shape of[object Object]is (10, 30).
Each operator has calls. First, [object Object] is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, [object Object] is called to perform computation.
[object Object][object Object]
Parameters:
[object Object](aclTensor*, computation input): required parameter, backpropagation gradient,[object Object]in the formula, aclTensor on the device. The data type can be FLOAT, FLOAT16, or BFLOAT16. If[object Object]is available, the shape can only be 2-dimensional. If[object Object]is not available, the shape can only be 3-dimensional. are supported. The can be ND.[object Object](aclTensor*, computation input): optional parameter, end position of each group,[object Object]in the formula, aclTensor on the device. The data type can be INT32 or INT64. The shape supports only one dimension. are supported. The can be ND.[object Object](aclTensor*, output): gradient of bias, out in the formula, aclTensor on the device. The data type can be FLOAT, FLOAT16, or BFLOAT16. The data type must be the same as that of[object Object]. The shape supports only two dimensions. are supported. The supports ND.[object Object](uint64_t*, output): size of the workspace to be allocated on the device.[object Object](aclOpExecutor**, output): operator executor, containing the operator computation process.
Returns:
Parameters:
[object Object](void*, input): address of the workspace to be allocated on the device.[object Object](uint64_t, input): size of the workspace to be allocated on the device, which is obtained by the first-phase API[object Object].[object Object](aclOpExecutor*, input): operator executor, containing the operator computation process.[object Object](aclrtStream, input): stream for executing the task.
Returns:
- Deterministic computing:
[object Object]defaults to a deterministic implementation.
[object Object]supports a maximum of 2048 numbers.
- If
[object Object]is available, ensure that the tensor data is sorted in ascending order and the last value is equal to the size of dimension 0 of[object Object].
- If
- If
[object Object]is available, ensure that the tensor values are not greater than the maximum INT32 value and are not negative numbers.
- If
The following example is for reference only. For details, see .