Linear Algebra Functions

Array API specification for linear algebra functions.

A conforming implementation of the array API standard must provide and support the following functions adhering to the following conventions.

  • Positional parameters must be positional-only parameters. Positional-only parameters have no externally-usable name. When a function accepting positional-only parameters is called, positional arguments are mapped to these parameters based solely on their order.

  • Optional parameters must be keyword-only arguments.

  • Broadcasting semantics must follow the semantics defined in Broadcasting.

  • Unless stated otherwise, functions must support the data types defined in Data Types.

  • Unless stated otherwise, functions must adhere to the type promotion rules defined in Type Promotion Rules.

  • Unless stated otherwise, floating-point operations must adhere to IEEE 754-2019.

Objects in API

matmul(x1, x2, /)

Computes the matrix product.

matrix_transpose(x, /)

Transposes a matrix (or a stack of matrices) x.

tensordot(x1, x2, /, *, axes=2)

Returns a tensor contraction of x1 and x2 over specific axes.

vecdot(x1, x2, /, *, axis=-1)

Computes the (vector) dot product of two arrays.