heat.array_api.linalg
Linear Algebra Extension for the Array API standard.
Module Contents
- matmul(x1: heat.array_api._array_object.Array, x2: heat.array_api._array_object.Array, /) heat.array_api._array_object.Array[source]
Computes the matrix product.
- matrix_transpose(x: heat.array_api._array_object.Array, /) heat.array_api._array_object.Array[source]
Transposes a matrix (or a stack of matrices)
x.- Parameters:
x (Array) – Input array having shape
(..., M, N)and whose innermost two dimensions formMxNmatrices.
- tensordot(x1: heat.array_api._array_object.Array, x2: heat.array_api._array_object.Array, /, *, axes: heat.array_api._typing.Union[int, heat.array_api._typing.Tuple[heat.array_api._typing.Sequence[int], heat.array_api._typing.Sequence[int]]] = 2) heat.array_api._array_object.Array[source]
Return a tensor contraction of
x1andx2over specific axes.- Parameters:
x1 (Array) – First input array. Must have a numeric data type.
x2 (Array) – Second input array. Must have a numeric data type. Corresponding contracted axes of
x1andx2must be equal.axes (Union[int, Tuple[Sequence[int], Sequence[int]]]) – Number of axes (dimensions) to contract or explicit sequences of axes (dimensions) for
x1andx2, respectively. Ifaxesis anintequal toN, then contraction is performed over the lastNaxes ofx1and the firstNaxes ofx2in order. The size of each corresponding axis (dimension) must match. Must be nonnegative. Ifaxesis a tuple of two sequences(x1_axes, x2_axes), the first sequence must apply tox1and the second sequence tox2. Both sequences must have the same length. Each axis (dimension)x1_axes[i]forx1must have the same size as the respective axis (dimension)x2_axes[i]forx2. Each sequence must consist of unique (nonnegative) integers that specify valid axes for each respective array.
- vecdot(x1: heat.array_api._array_object.Array, x2: heat.array_api._array_object.Array, /, *, axis: int = -1) heat.array_api._array_object.Array[source]
Computes the (vector) dot product of two arrays.
- Parameters:
x1 (Array) – First input array. Must have a numeric data type.
x2 (Array) – Second input array. Must be compatible with
x1and have a numeric data type.axis (int) – Axis over which to compute the dot product. Must be an integer on the interval
[-N, N), whereNis the rank (number of dimensions) of the shape determined according to Broadcasting. If specified as a negative integer, the function determines the axis along which to compute the dot product by counting backward from the last dimension (where-1refers to the last dimension). By default, the function computes the dot product over the last axis. Default:-1.