[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Multiplies batch1 and batch2 and sums up the results by the first dimension (batch dimension). Compresses the three-dimensional vector into a two-dimensional vector (the shape is that of the last two dimensions). Multiplies the result by α, and then adds the result to the product of β and self to obtain the result.

  • Formula:

    out=βself+α(i=0b1batch1i@batch2i)out = βself+α(\sum_{i=0}^{b-1} batch1_{i}@batch2_{i})

    Note: If β is 0, self is ignored and does not participate in the calculation. If α is 0, batch1 and batch2 are ignored and do not participate in the calculation.

  • Example:

    The shape of self is [3,5], the shape of batch1 is [10,3,4], the shape of batch2 is [10,4,5], and the shape of the output out is [3,5].

[object Object]
  • aclnnAddbmm and aclnnInplaceAddbmm implement the same function in different ways. Select a proper operator based on your requirements.
    • aclnnAddbmm: An output tensor object needs to be created to store the computation result.
    • aclnnInplaceAddbmm: 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, aclnnAddbmmGetWorkspaceSize or aclnnInplaceAddbmmGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnAddbmm or aclnnInplaceAddbmm is called to perform computation.
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
  • Parameters:

    [object Object]
    • [object Object]Atlas training series products[object Object] and [object Object]Atlas inference series products[object Object]:
      • The data type BFLOAT16 is not supported.
      • cubeMathType=0 is not supported when the input data type is FLOAT32.
      • cubeMathType=1: If the input data type is FLOAT32, it is converted to FLOAT16 for computation. If the input data type is not FLOAT32, no processing is performed.
      • cubeMathType=3 is not supported.
    • [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]:
      • cubeMathType=1: If the input data type is FLOAT32, it is converted to HFLOAT32 for computation. If the input data type is not FLOAT32, no processing is performed.
      • cubeMathType=2: If the input data type is BFLOAT16, this option is not supported.
      • cubeMathType=3: If the input data type is FLOAT32, it is converted to HFLOAT32 for computation. If the input data type is not FLOAT32, this option is not supported.
  • Returns:

    aclnnStatus: 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]
  • Returns:

    aclnnStatus: status code. For details, see .

[object Object]
  • Parameters:

    [object Object]
    • [object Object]Atlas training series products[object Object] and [object Object]Atlas inference series products[object Object]:
      • The data type BFLOAT16 is not supported.
      • cubeMathType=0 is not supported when the input data type is FLOAT32.
      • cubeMathType=1: If the input data type is FLOAT32, it is converted to FLOAT16 for computation. If the input data type is not FLOAT32, no processing is performed.
      • cubeMathType=3 is not supported.
    • [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]:
      • cubeMathType=1: If the input data type is FLOAT32, it is converted to HFLOAT32 for computation. If the input data type is not FLOAT32, no processing is performed.
      • cubeMathType=2: If the input data type is BFLOAT16, this option is not supported.
      • cubeMathType=3: If the input data type is FLOAT32, it is converted to HFLOAT32 for computation. If the input data type is not FLOAT32, this option is not supported.
  • Returns:

    aclnnStatus: 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]
  • Returns:

    aclnnStatus: status code. For details, see .

[object Object]
  • Determinism:
    • [object Object]Atlas training series products[object Object] and [object Object]Atlas inference series products[object Object]: aclnnAddbmm&aclnnInplaceAddbmm defaults to a deterministic implementation.
  • [object Object]Atlas training series products[object Object] and [object Object]Atlas inference series products[object Object]: The Cube unit does not support FLOAT32 computation. The input data type FLOAT32 can be converted to FLOAT16 in the API for computation by setting cubeMathType to 1 (ALLOW_FP32_DOWN_PRECISION).
  • [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]: If one of the inputs of batch1 and batch2 is BFLOAT16 and the other is FLOAT or FLOAT16, the data type cannot be deduced.
[object Object]

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

[object Object]