cupy.matmul

cupy.matmul(x1, x2, out=None, *, axes=None)[source]

Matrix product of two arrays.

Returns the matrix product of two arrays and is the implementation of the @ operator introduced in Python 3.5 following PEP465.

The main difference against cupy.dot are the handling of arrays with more than 2 dimensions. For more information see numpy.matmul().

Note

The out array as input is currently not supported.

Parameters
  • x1 (cupy.ndarray) – The left argument.

  • x2 (cupy.ndarray) – The right argument.

  • out (cupy.ndarray, optional) – Output array.

  • axes (List of tuples of int, optional) – A list of tuples with indices of axes the matrix multiplication should operate on.

Returns

Output array.

Return type

cupy.ndarray

See also

numpy.matmul()