[object Object][object Object][object Object]undefined
[object Object]
  • Description: Writes values from scalar value into tensor self one by one according to the specified axis, direction, and corresponding position relationship. value will be broadcast into tensor src whose shape is the same as that of tensor index for Scatter computation.

  • Example: For a three-dimensional tensor, self is updated based on the following rules:

    [object Object]

    The following conditions must be met during computation:

    • self and index must have the same number of dimensions.
    • For each dimension d, if d != dim, there is a restriction that index.size(d) <= self.size(d).
    • The value of dim must be in the range of [–(number of dimensions of self), (number of dimensions of self) – 1].
    • The number of dimensions of self must be less than or equal to eight.
    • The corresponding dim value in index must be in the range of [0, self.size(dim) – 1].
[object Object]
  • aclnnScatterValue and aclnnInplaceScatterValue implement the same function in different ways. Select a proper operator based on your requirements.

    • aclnnScatterValue: An output tensor object needs to be created to store the computation result.
    • aclnnInplaceScatterValue: No output tensor object needs to be created, and the computation result is stored in the memory of the input tensor.
  • Each operator has calls. First, aclnnScatterValueGetWorkspaceSize or aclnnInplaceScatterValueGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnScatterValue or aclnnInplaceScatterValue is called to perform computation.

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

    • self (aclTensor*, compute input): [object Object] in the formula, aclTensor on the device. It indicates the target tensor of scatter. self must have the same number of dimensions as index, and the shape supports zero to eight dimensions. are supported. The can be ND.

      • [object Object]Atlas A3 training products/Atlas A3 inference products[object Object], [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]: The data type can be UINT8, INT8, INT16, INT32, INT64, BOOL, FLOAT16, FLOAT32, DOUBLE, COMPLEX64, COMPLEX128, or BFLOAT16.
    • dim (int64_t, compute input): dimension used for scattering. The data type can be INT64. The value range is [–(number of dimensions of self), (number of dimensions of self) – 1].

    • index (aclTensor*, compute input): [object Object] in the formula, aclTensor on the device. It indicates the index tensor. The data type can be INT32 or INT64. index must have the same number of dimensions as self, and the shape supports zero to eight dimensions. are supported. The can be ND.

    • value (aclScalar*, compute input): aclScalar on the host. When value is COMPLEX, self must also be a COMPLEX tensor. There are no other data type restrictions.

    • reduce (int64_t, compute input): the reduction operation to be applied. The options and corresponding int values are add (1), mul (2), and none (0). The specific operations are defined as follows: 0: replaces value to the corresponding position in out according to index. 1: accumulates value to the corresponding position in out according to index. 2: multiplies value to the corresponding position in out according to index.

    • out (aclTensor*, compute output): tensor for storing the scatter output. The , data type, and shape must be the same as those of self.

      • [object Object]Atlas A3 training products/Atlas A3 inference products[object Object], [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]: The data type can be UINT8, INT8, INT16, INT32, INT64, BOOL, FLOAT16, FLOAT32, DOUBLE, COMPLEX64, COMPLEX128, or BFLOAT16.
    • workspaceSize(uint64_t*, output parameter): size of the workspace required to be allocated on the device.

    • executor(aclOpExecutor, output parameter): operator executor, containing the operator computation process.

  • Returns:

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

    [object Object]
[object Object]
  • Parameters:

    • workspace(void*, input parameter): address of the workspace to be allocated on the device.

    • workspaceSize(uint64_t, input parameter): size of the workspace to be allocated on the device, which is obtained by calling the first-phase aclnnScatterValueGetWorkspaceSize.

    • executor(aclOpExecutor*, input parameter): operator executor, containing the operator computation process.

    • stream(aclrtStream, input parameter): stream for executing the task.

  • Returns:

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

[object Object]
  • Parameters:

    • selfRef (aclTensor*, compute input | compute output): [object Object] in the formula, aclTensor on the device. It indicates the target tensor of scatter. selfRef must have the same number of dimensions as index, and the shape supports zero to eight dimensions. Empty tensors and are supported. The can be ND.
      • [object Object]Atlas A3 training products/Atlas A3 inference products[object Object], [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]: The data type can be UINT8, INT8, INT16, INT32, INT64, BOOL, FLOAT16, FLOAT, DOUBLE, COMPLEX64, COMPLEX128, or BFLOAT16.
    • dim (int64_t, compute input): dimension used for scattering. The data type can be INT64. The value range is [–(number of dimensions of selfRef), (number of dimensions of selfRef) – 1].
    • index (aclTensor*, compute input): [object Object] in the formula, aclTensor on the device. It indicates the index tensor. The data type can be INT32 or INT64. index must have the same number of dimensions as selfRef, and the shape supports zero to eight dimensions. For each dimension d, if d != dim, ensure that index.size(d) <= selfRef.size(d). Empty tensors and are supported. The can be ND.
    • value (aclScalar*, compute input): When value is COMPLEX, selfRef must also be a COMPLEX tensor. There are no other data type restrictions.
    • reduce (int64_t, compute input): the reduction operation to be applied. The options and corresponding int values are add (1), mul (2), and none (0). The specific operations are defined as follows: 0: replaces value to the corresponding position in selfRef according to index. 1: accumulates value to the corresponding position in selfRef according to index. 2: multiplies value to the corresponding position in selfRef according to index.
    • workspaceSize(uint64_t, output parameter): size of the workspace required to be allocated on the device.
    • executor(aclOpExecutor**, output parameter): operator executor, containing the operator computation process.
  • Returns: [object Object]: status code. For details, see .

    [object Object]
[object Object]
  • Parameters:

    • workspace(void*, input parameter): address of the workspace to be allocated on the device.
    • workspaceSize(uint64_t, input parameter): size of the workspace to be allocated on the device, which is obtained by calling the first-phase aclnnInplaceScatterValueGetWorkspaceSize.
    • executor(aclOpExecutor*, input parameter): operator executor, containing the operator computation process.
    • stream(aclrtStream, input parameter): stream for executing the task.
  • Returns: [object Object]: status code. For details, see .

[object Object]
  • Deterministic compute:
    • aclnnScatterValue and aclnnInplaceScatterValue default to a deterministic implementation.
[object Object]

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

aclnnScatterValue sample code:

[object Object]

aclnnInplaceScatterValue sample code:

[object Object]