1616
1717import operator
1818
19- from numpy .core .numeric import normalize_axis_index , normalize_axis_tuple
20-
2119import dpctl
2220import dpctl .tensor as dpt
2321import dpctl .tensor ._tensor_elementwise_impl as tei
3230)
3331from dpctl .utils import ExecutionPlacementError , SequentialOrderManager
3432
33+ from ._numpy_helper import normalize_axis_index , normalize_axis_tuple
34+
3535
3636def matrix_transpose (x ):
37- """matrix_transpose(x)
37+ r """matrix_transpose(x)
3838
3939 Transposes the innermost two dimensions of `x`, where `x` is a
4040 2-dimensional matrix or a stack of 2-dimensional matrices.
@@ -65,7 +65,7 @@ def matrix_transpose(x):
6565
6666
6767def tensordot (x1 , x2 , axes = 2 ):
68- """tensordot(x1, x2, axes=2)
68+ r """tensordot(x1, x2, axes=2)
6969
7070 Returns a tensor contraction of `x1` and `x2` over specific axes.
7171
@@ -308,7 +308,7 @@ def tensordot(x1, x2, axes=2):
308308
309309
310310def vecdot (x1 , x2 , axis = - 1 ):
311- """vecdot(x1, x2, axis=-1)
311+ r """vecdot(x1, x2, axis=-1)
312312
313313 Computes the (vector) dot product of two arrays.
314314
@@ -574,7 +574,7 @@ def vecdot(x1, x2, axis=-1):
574574
575575
576576def matmul (x1 , x2 , out = None , dtype = None , order = "K" ):
577- """matmul(x1, x2, out=None, order="K")
577+ r """matmul(x1, x2, out=None, order="K")
578578
579579 Computes the matrix product. Implements the same semantics
580580 as the built-in operator `@`.
@@ -721,7 +721,8 @@ def matmul(x1, x2, out=None, dtype=None, order="K"):
721721 buf1_dt = res_dt
722722 else :
723723 raise ValueError (
724- f"`matmul` input `x1` cannot be cast from { x1_dtype } to "
724+ r"`matmul` input `x1` cannot be cast from "
725+ f"{ x1_dtype } to "
725726 f"requested type { res_dt } according to the casting rule "
726727 "''same_kind''."
727728 )
@@ -730,7 +731,8 @@ def matmul(x1, x2, out=None, dtype=None, order="K"):
730731 buf2_dt = res_dt
731732 else :
732733 raise ValueError (
733- f"`matmul` input `x2` cannot be cast from { x2_dtype } to "
734+ r"`matmul` input `x2` cannot be cast from "
735+ f"{ x2_dtype } to "
734736 f"requested type { res_dt } according to the casting rule "
735737 "''same_kind''."
736738 )
@@ -762,7 +764,7 @@ def matmul(x1, x2, out=None, dtype=None, order="K"):
762764
763765 if res_dt != out .dtype :
764766 raise ValueError (
765- f"Output array of type { res_dt } is needed," f" got { out .dtype } "
767+ f"Output array of type { res_dt } is needed, got { out .dtype } "
766768 )
767769
768770 if dpctl .utils .get_execution_queue ((exec_q , out .sycl_queue )) is None :
0 commit comments