[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Updates the values in data one by one by referring to the values in updates based on the specified axis and indices. The operator semantics are customized without corresponding TensorFlow or PyTorch APIs.

  • Example: This operator has three inputs and one attribute: data, updates, indices, and axis. data is the tensor to be updated, updates is the tensor containing the update data, and indices specifies the update locations. axis specifies the update dimension. When indices is one-dimensional, there are two scenarios:

    Scenario 1: When indices is one-dimensional, axis specifies that the shape of the update dimension is 1 and indices specifies the offset of each batch dimension (the highest dimension) in the axis dimension.

    [object Object]
    [object Object]

    Scenario 2: When indices is one-dimensional, axis specifies that the shape of the update dimension is greater than 1 and indices specifies the offset of each batch dimension (the highest dimension) in the axis dimension.

    [object Object]
    [object Object]
[object Object]

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

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

    • data (aclTensor*, compute input | compute output): It supports 2 to 8 dimensions, and the number of dimensions must be the same as that of updates. are supported. The can be ND. Empty tensors are not supported.
      • [object Object]Atlas training series products[object Object]: The data type can be INT8, FLOAT16, FLOAT32, or 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 INT8, FLOAT16, FLOAT32, INT32, or BFLOAT16.
    • indices (aclTensor*, compute input): The data type can be INT32 or INT64. Currently, only zero, one, and two dimensions are supported. are supported. The can be ND. Empty tensors are not supported. Only non-negative indices are supported. The data in indices cannot be out-of-bounds.
    • updates (aclTensor*, compute input): The data type must be the same as that of data, and the number of dimensions in the shape must be the same as that of the data shape. are supported. The can be ND. Empty tensors are not supported.
      • [object Object]Atlas training series products[object Object]: The data type can be INT8, FLOAT16, FLOAT32, or 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 INT8, FLOAT16, FLOAT32, INT32, or BFLOAT16.
    • axis (int64_t, compute input): dimension to scatter. The data type is INT64. The value range is (-data_rank, data_rank) (data_rank indicates the number of dimensions of data). axis cannot be 0.
    • workspaceSize (uint64_t *, output): size of the workspace to be allocated on the device.
    • executor (aclOpExecutor **, output): operator executor, containing the operator computation process.
  • Returns: aclnnStatus: 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 aclnnInplaceScatterUpdateGetWorkspaceSize.
    • executor (aclOpExecutor *, input): operator executor, containing the operator computation process.
    • stream (aclrtStream, input): stream for executing the task.
  • Returns: aclnnStatus: status code. For details, see .

[object Object]
  • Deterministic compute:

    • aclnnInplaceScatterUpdate defaults to a deterministic implementation.
  • The 0th axis of the updates shape must be consistent with that of the indices shape.

  • If indices is zero-dimensional, the 0th axis of the updates shape must be 1.

  • The 0th axis of the updates shape must be less than or equal to that of the data shape.

  • The shapes of updates and data are the same except for the axis and 0th axis.

  • When the indices shape is two-dimensional, the 1st axis of the shape must be 2.

  • If the data type of indices is INT32, DtypeSize is 4. If the data type of indices is INT64, DtypeSize is 8. IndicesShapeSize is the product of the indices shape. The required UB is calculated as follows: UB = IndicesShapeSize x DtypeSize + 224. If the required UB size is greater than the total UB size of the corresponding AI processor version, the operation is not supported.

  • If indices contains duplicates, the output at those positions is non-deterministic.

[object Object]

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

[object Object]