[object Object][object Object][object Object]undefined
[object Object]
  • Description: Implements the functions compatible with tf.compat.v1.scatter_add and tf.compat.v1.scatter_nd_add. Adds the values in tensor updates to the slices of tensor varRef based on the specified index tensor indices. If more than one updates value is written to the same slice of varRef, these values are accumulated at this slice. The rules are as follows:
varRef[indices[i,...,j],...]=varRef[indices[i,...,j],...]+updatesvarRef[indices[i,...,j],...] = varRef[indices[i,...,j],...] + updates

Or:

varRef[indices[i,:]]=varRef[indices[i,:]]+updates[i,...]varRef[indices[i,:]] = varRef[indices[i,:]] + updates[i,...] [object Object]

Each operator has calls. First, aclnnTfScatterAddGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnTfScatterAdd is called to perform computation.

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

    • varRef (aclTensor*, compute input/output): input [object Object] in the formula, initial tensor to be updated, aclTensor on the device. are supported. The can be ND, and one to eight dimensions are supported. The data type must be the same as that of updates. The data type can be FLOAT32, FLOAT16, BFLOAT16, INT32, INT8, or UINT8.
    • indices (aclTensor*, compute input): input [object Object] in the formula, index position to be updated, aclTensor on the device. are supported. The can be ND, and one to eight dimensions are supported. An out-of-bounds index is not supported in indices. If an out-of-bounds index occurs, varRef is not updated. The data type can be INT32 or INT64.
    • updates (aclTensor*, compute input): input [object Object] in the formula, updated value to be added to [object Object], aclTensor on the device. are supported. The can be ND, and one to eight dimensions are supported. The data type must be the same as that of varRef. The data type can be FLOAT32, FLOAT16, BFLOAT16, INT32, INT8, or UINT8.
    • workspaceSize (uint64_t *, compute input): size of the workspace required to be allocated on the device.
    • [object Object] (aclOpExecutor **, output): operator executor, containing the operator computation process.
  • Returns

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

    [object Object]
[object Object]
  • 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 aclnnTfScatterAddGetWorkspaceSize.
    • executor (aclOpExecutor *, input): operator executor, containing the operator computation process.
    • stream (aclrtStream, input): stream for executing the task.
  • Returns

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

[object Object]
  • Deterministic compute:
    • aclnnTfScatterAdd defaults to a non-deterministic implementation. It can be configured to a deterministic implementation via deterministic computation settings.
  • One of the following constraints must be met:
    • updates.shape = indices.shape + varRef.shape[1:]
    • indices.shape[-1] <= varRef.shape.rank and updates.shape = indices.shape[:-1] + varRef.shape[indices.shape[-1]:]
[object Object]

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

[object Object]