[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Adds the specified tensor value to each tensor in the tensor list.

  • Formula:

    x=[x0,x1,...xn1]y=[y0,y1,...yn1]x = [{x_0}, {x_1}, ... {x_{n-1}}]\\ y = [{y_0}, {y_1}, ... {y_{n-1}}]\\ yi=xi+scalar(i=0,1,...n1)y_i = {x}_{i}+{scalar} (i=0,1,...n-1)
[object Object]

Each operator has calls. First, aclnnForeachAddScalarGetWorkspaceSize is called to obtain the input parameters and compute the required workspace size based on the process. Then, aclnnForeachAddScalar is called to perform computation.

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

    [object Object]
    • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]:

      The data type of [object Object] depends on that of [object Object]:

      • When [object Object] is of the FLOAT32, FLOAT16, or INT32 type, the data type must be the same as that of [object Object].
      • When [object Object] is of the BFLOAT16 type, the data type must be FLOAT32.
    • Ascend 950PR/Ascend 950DT:

      • The maximum number of tensors supported by [object Object] and [object Object] is 50.
      • The data type of [object Object] depends on that of [object Object]:
        • When the data type of [object Object] is FLOAT32 or INT32, the data type is the same as that of [object Object].
        • When [object Object] is of the BFLOAT16 type, the data type must be FLOAT32.
        • When the data type of [object Object] is FLOAT16, the data type can be FLOAT16 or FLOAT32.
  • Return Value

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

    The first-phase API implements input parameter verification. The following errors may be thrown.

    [object Object]
[object Object]
  • Parameters

    [object Object]
  • Return Value

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

[object Object]
  • Deterministic computation:
    • aclnnForeachAddScalar defaults to a deterministic implementation.
[object Object]

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

[object Object]