You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spec/API_specification/linear_algebra_functions.md
+30-5
Original file line number
Diff line number
Diff line change
@@ -115,11 +115,6 @@ Returns the specified diagonals. If `x` has more than two dimensions, then the a
115
115
116
116
- if `x` is a two-dimensional array, a one-dimensional array containing the diagonal; otherwise, a multi-dimensional array containing the diagonals and whose shape is determined by removing `axis1` and `axis2` and appending a dimension equal to the size of the resulting diagonals. The returned array must have the same data type as `x`.
117
117
118
-
(function-dot)=
119
-
### dot()
120
-
121
-
TODO
122
-
123
118
(function-eig)=
124
119
### eig()
125
120
@@ -400,3 +395,33 @@ Transposes (or permutes the axes (dimensions)) of an array `x`.
400
395
- **out**: _<array>_
401
396
402
397
- an array containing the transpose. The returned array must have the same data type as `x`.
398
+
399
+
(function-vecdot)=
400
+
### vecdot(x1, x2, /, *, axis=None)
401
+
402
+
Computes the (vector) dot product of two arrays.
403
+
404
+
#### Parameters
405
+
406
+
- **x1**: _<array>_
407
+
408
+
- first input array. Should have a numeric data type.
409
+
410
+
- **x2**: _<array>_
411
+
412
+
- second input array. Must be compatible with `x1` (see {ref}`broadcasting`). Should have a numeric data type.
413
+
414
+
- **axis**: _Optional\[ int ]_
415
+
416
+
- 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 {ref}`broadcasting`. If specified as a negative integer, the function must determine the axis along which to compute the dot product by counting backward from the last dimension (where `-1` refers to the last dimension). If `None`, the function must compute the dot product over the last axis. Default: `None`.
417
+
418
+
#### Returns
419
+
420
+
- **out**: _<array;>_
421
+
422
+
- if `x1` and `x2` are both one-dimensional arrays, a zero-dimensional containing the dot product; otherwise, a non-zero-dimensional array containing the dot products and having rank `N-1`, where `N` is the rank (number of dimensions) of the shape determined according to {ref}`broadcasting`. The returned array must have a data type determined by {ref}`type-promotion`.
423
+
424
+
#### Raises
425
+
426
+
- if provided an invalid `axis`.
427
+
- if the size of the axis over which to compute the dot product is not the same for both `x1` and `x2`.
0 commit comments