asdMul

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

Not supported

Function Description

API function: This API supports the element-wise product (Hadamard) capability of vectors. It returns a complex matrix with the same shape and size as the input matrix.

Formula:

  • The calculation formula of asdMul is . That is, the elements in the corresponding positions of two matrices are multiplied.
  • Example:

    Input A:

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

    Input B:

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

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

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

Function Prototype

AspbStatus asdMul(int n, const void *x, const void *y, const void *z, void *stream, void *workspace = nullptr)

Parameter Description

asdMul

Parameter

Input/Output

Type

Description

n

Input

int

Number of input elements.

x

Input

const void *

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

y

Input

const void *

B in the formula, tensor on the device. The data type can be COMPLEX32 or COMPLEX64, the data format can be ND, and the shape is [n].

z

Input

const void *

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

stream

Input

void*

NPU execution stream.

workspace

Input

void *

Workspace required by the asdMul operator.

Return Value Description

For details about the return values, see Return Value.

Constraints

asdMul

  • The supported input data types are COMPLEX32 and COMPLEX64.
  • The supported output data types are COMPLEX32 and COMPLEX64.
  • The theoretical range of the number of input elements n is [1, 9.22e+18].
  • The input shape of the operator is [n] and [n], and the output shape is [n].

Calling Example

For details about the operator calling example, see mul_complex32 or mul_complex64.