:mod:`heat.array_api.linalg` ============================ .. py:module:: heat.array_api.linalg .. autoapi-nested-parse:: Linear Algebra Extension for the Array API standard. Module Contents --------------- .. function:: matmul(x1: heat.array_api._array_object.Array, x2: heat.array_api._array_object.Array, /) -> heat.array_api._array_object.Array Computes the matrix product. :param x1: First input array. Must have a numeric data type and at least one dimension. :type x1: Array :param x2: Second input array. Must have a numeric data type and at least one dimension. :type x2: Array .. function:: matrix_transpose(x: heat.array_api._array_object.Array, /) -> heat.array_api._array_object.Array Transposes a matrix (or a stack of matrices) ``x``. :param x: Input array having shape ``(..., M, N)`` and whose innermost two dimensions form ``MxN`` matrices. :type x: Array .. function:: 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 Return a tensor contraction of ``x1`` and ``x2`` over specific axes. :param x1: First input array. Must have a numeric data type. :type x1: Array :param x2: Second input array. Must have a numeric data type. Corresponding contracted axes of ``x1`` and ``x2`` must be equal. :type x2: Array :param axes: Number of axes (dimensions) to contract or explicit sequences of axes (dimensions) for ``x1`` and ``x2``, respectively. If ``axes`` is an ``int`` equal to ``N``, then contraction is performed over the last ``N`` axes of ``x1`` and the first ``N`` axes of ``x2`` in order. The size of each corresponding axis (dimension) must match. Must be nonnegative. If ``axes`` is a tuple of two sequences ``(x1_axes, x2_axes)``, the first sequence must apply to ``x1`` and the second sequence to ``x2``. Both sequences must have the same length. Each axis (dimension) ``x1_axes[i]`` for ``x1`` must have the same size as the respective axis (dimension) ``x2_axes[i]`` for ``x2``. Each sequence must consist of unique (nonnegative) integers that specify valid axes for each respective array. :type axes: Union[int, Tuple[Sequence[int], Sequence[int]]] .. function:: vecdot(x1: heat.array_api._array_object.Array, x2: heat.array_api._array_object.Array, /, *, axis: int = -1) -> heat.array_api._array_object.Array Computes the (vector) dot product of two arrays. :param x1: First input array. Must have a numeric data type. :type x1: Array :param x2: Second input array. Must be compatible with ``x1`` and have a numeric data type. :type x2: Array :param axis: Axis over which to compute the dot product. Must be an integer on the interval ``[-N, N)``, where ``N`` is 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 ``-1`` refers to the last dimension). By default, the function computes the dot product over the last axis. Default: ``-1``. :type axis: int