@@ -830,8 +830,7 @@ def matmul(
830830 >>> np.dot(a, c).shape
831831 (9, 5, 7, 9, 5, 3)
832832 >>> np.matmul(a, c).shape
833- (9, 5, 7, 3)
834- >>> # n is 7, k is 4, m is 3
833+ (9, 5, 7, 3) # n is 7, k is 4, m is 3
835834
836835 Examples
837836 --------
@@ -872,7 +871,7 @@ def matmul(
872871 >>> np.matmul(x1, x2)
873872 array(-13+0j)
874873
875- The ``@`` operator can be used as a shorthand for `` matmul` ` on
874+ The ``@`` operator can be used as a shorthand for :obj:`dpnp. matmul` on
876875 :class:`dpnp.ndarray`.
877876
878877 >>> x1 @ x2
@@ -881,6 +880,7 @@ def matmul(
881880 """
882881
883882 dpnp .check_limitations (subok_linalg = subok , signature = signature )
883+ dpnp .check_supported_arrays_type (x1 , x2 )
884884
885885 return dpnp_multiplication (
886886 "matmul" ,
@@ -913,7 +913,7 @@ def matvec(
913913 Matrix-vector dot product of two arrays.
914914
915915 Given a matrix (or stack of matrices) :math:`\mathbf{A}` in `x1` and
916- a vector (or stack of vectors) :math:`\mathbf{v}` `x2`, the
916+ a vector (or stack of vectors) :math:`\mathbf{v}` in `x2`, the
917917 matrix-vector product is defined as:
918918
919919 .. math::
@@ -952,11 +952,11 @@ def matvec(
952952
953953 Default: ``"K"``.
954954 axes : {None, list of tuples}, optional
955- A list of tuples with indices of axes the matrix product should operate
956- on. For instance, for the signature of ``(i,j),(j)->(i)``, the base
957- elements are 2d matrices and 1d vectors, where the matrices are assumed
958- to be stored in the last two axes of the first argument, and the
959- vectors in the last axis of the second argument. The corresponding
955+ A list of tuples with indices of axes the matrix-vector product should
956+ operate on. For instance, for the signature of ``(i,j),(j)->(i)``, the
957+ base elements are 2d matrices and 1d vectors, where the matrices are
958+ assumed to be stored in the last two axes of the first argument, and
959+ the vectors in the last axis of the second argument. The corresponding
960960 axes keyword would be ``[(-2, -1), (-1,), (-1,)]``.
961961
962962 Default: ``None``.
@@ -1000,6 +1000,7 @@ def matvec(
10001000 """
10011001
10021002 dpnp .check_limitations (subok_linalg = subok , signature = signature )
1003+ dpnp .check_supported_arrays_type (x1 , x2 )
10031004
10041005 return dpnp_multiplication (
10051006 "matvec" ,
@@ -1333,7 +1334,7 @@ def vecdot(
13331334
13341335 Default: ``None``.
13351336 axes : {None, list of tuples}, optional
1336- A list of tuples with indices of axes the matrix product should operate
1337+ A list of tuples with indices of axes the dot product should operate
13371338 on. For instance, for the signature of ``(i),(i)->()``, the base
13381339 elements are vectors and these are taken to be stored in the last axes
13391340 of each argument. The corresponding axes keyword would be
@@ -1414,7 +1415,7 @@ def vecmat(
14141415 Vector-matrix dot product of two arrays.
14151416
14161417 Given a vector (or stack of vector) :math:`\mathbf{v}` in `x1` and a matrix
1417- (or stack of matrices) :math:`\mathbf{A}` `x2`, the vector-matrix product
1418+ (or stack of matrices) :math:`\mathbf{A}` in `x2`, the vector-matrix product
14181419 is defined as:
14191420
14201421 .. math::
@@ -1455,12 +1456,12 @@ def vecmat(
14551456
14561457 Default: ``"K"``.
14571458 axes : {None, list of tuples}, optional
1458- A list of tuples with indices of axes the matrix product should operate
1459- on. For instance, for the signature of ``(i),(i,j)->(j)``, the base
1460- elements are 1D vectors and 2D matrices, where the vectors are assumed
1461- to be stored in the last axis of the first argument, and the matrices
1462- in the last two axes of the second argument. The corresponding axes
1463- keyword would be ``[(-1,), (-2, -1), (-1,)]``.
1459+ A list of tuples with indices of axes the vector- matrix product should
1460+ operate on. For instance, for the signature of ``(i),(i,j)->(j)``, the
1461+ base elements are 1D vectors and 2D matrices, where the vectors are
1462+ assumed to be stored in the last axis of the first argument, and the
1463+ matrices in the last two axes of the second argument. The corresponding
1464+ axes keyword would be ``[(-1,), (-2, -1), (-1,)]``.
14641465
14651466 Default: ``None``.
14661467
@@ -1490,14 +1491,18 @@ def vecmat(
14901491 >>> v = np.array([0., 4., 2.])
14911492 >>> a = np.array([[1., 0., 0.],
14921493 ... [0., 1., 0.],
1493- ... [0., 0., 1.],
1494- ... [0., 6., 8.]])
1494+ ... [0., 0., 0.]])
14951495 >>> np.vecmat(v, a)
1496- array([ 0., 4., 0.])
1496+ array([0., 4., 0.])
14971497
14981498 """
14991499
15001500 dpnp .check_limitations (subok_linalg = subok , signature = signature )
1501+ dpnp .check_supported_arrays_type (x1 , x2 )
1502+
1503+ # cannot directly use dpnp.conj(x1) as it returns `int8` for boolean input
1504+ if dpnp .issubdtype (x1 .dtype , dpnp .complexfloating ):
1505+ x1 = dpnp .conj (x1 )
15011506
15021507 return dpnp_multiplication (
15031508 "vecmat" ,
0 commit comments