Colwise_mul

Applicable Products

Hardware Model

Supported or Not

Atlas 200I/500 A2 inference products

Not supported

Atlas inference products

Not supported

Atlas training products

Not supported

Atlas A2 training products / Atlas A2 inference products

Supported

Atlas A3 inference products / Atlas A3 training products

Supported

Function Description

API function

  • asdBlasMakeColwiseMulPlan: initializes the ColwiseMul operator configuration corresponding to the handle.
  • asdBlasColwiseMul: performs an element-wise multiplication between a complex matrix and a complex vector along the columns. It returns a complex matrix of the same dimensions and shape as the original input.

Formula:

  • asdBlasColwiseMul calculation formula:

  • Example:

    Input A:

    [ [ 1+1i, 1+1i ],
      [ 2+2i, 2+2i ] ]

    Input X:

    [ 1+1i, 2+2i ]

    After the asdBlasColwiseMul operator is called, the output result is as follows:

    [ [ 0+2i, 0+2i ],
      [ 0+8i, 0+8i ] ]

Function Prototype

  • AspbStatus asdBlasMakeColwiseMulPlan(asdBlasHandle handle)
  • AspbStatus asdBlasColwiseMul(asdBlasHandle handle, const int64_t m, const int64_t n, aclTensor *mat, aclTensor *vec,aclTensor *result)

Parameter Description

  • asdBlasMakeColwiseMulPlan

    Parameter

    Input/Output

    Type

    Description

    handle

    Input

    asdBlasHandle

    Handle of the ColwiseMul operator.

  • asdBlasColwiseMul

    Parameter

    Input/Output

    Type

    Description

    handle

    Input

    asdBlasHandle

    Handle of the ColwiseMul operator.

    m

    Input

    const int64_t

    Number of rows of matrix mat, and number of elements in vector vec.

    n

    Input

    const int64_t

    Number of columns in matrix mat.

    mat

    Input

    aclTensor *

    A in the formula, which is a tensor on the device. The data type can be COMPLEX64, the data format can be ND, and the shape is [m, n].

    vec

    Input

    aclTensor *

    x in the formula, which is a complex vector and a tensor on the Device side. The data type can be COMPLEX64, the data format can be ND, and the shape is [m].

    result

    Output

    aclTensor *

    result in the formula, which is a tensor on the device. The data type can be COMPLEX64, the data format can be ND, and the shape is [m, n]. The data format, data type, and shape are consistent with those of the input parameter mat.

Return Value Description

For details about the return values, see Return Value.

Constraints

  • asdBlasMakeColwiseMulPlan: none.
  • asdBlasColwiseMul
    • The input shape of the operator is [m, n] or [m], and the output shape is [m, n].
    • The operator does not support the calculation for three or more dimensions.

Calling Example

For details about the operator calling example, see Colwise_mul.