@@ -1055,9 +1055,9 @@ def dot(*arrays, dims=None, **kwargs):
1055
1055
----------
1056
1056
arrays: DataArray (or Variable) objects
1057
1057
Arrays to compute.
1058
- dims: str or tuple of strings, optional
1059
- Which dimensions to sum over.
1060
- If not speciified , then all the common dimensions are summed over.
1058
+ dims: '...', str or tuple of strings, optional
1059
+ Which dimensions to sum over. Ellipsis ('...') sums over all dimensions.
1060
+ If not specified , then all the common dimensions are summed over.
1061
1061
**kwargs: dict
1062
1062
Additional keyword arguments passed to numpy.einsum or
1063
1063
dask.array.einsum
@@ -1070,7 +1070,7 @@ def dot(*arrays, dims=None, **kwargs):
1070
1070
--------
1071
1071
1072
1072
>>> import numpy as np
1073
- >>> import xarray as xp
1073
+ >>> import xarray as xr
1074
1074
>>> da_a = xr.DataArray(np.arange(3 * 2).reshape(3, 2), dims=['a', 'b'])
1075
1075
>>> da_b = xr.DataArray(np.arange(3 * 2 * 2).reshape(3, 2, 2),
1076
1076
... dims=['a', 'b', 'c'])
@@ -1117,6 +1117,14 @@ def dot(*arrays, dims=None, **kwargs):
1117
1117
[273, 446, 619]])
1118
1118
Dimensions without coordinates: a, d
1119
1119
1120
+ >>> xr.dot(da_a, da_b)
1121
+ <xarray.DataArray (c: 2)>
1122
+ array([110, 125])
1123
+ Dimensions without coordinates: c
1124
+
1125
+ >>> xr.dot(da_a, da_b, dims=...)
1126
+ <xarray.DataArray ()>
1127
+ array(235)
1120
1128
"""
1121
1129
from .dataarray import DataArray
1122
1130
from .variable import Variable
@@ -1141,7 +1149,9 @@ def dot(*arrays, dims=None, **kwargs):
1141
1149
einsum_axes = "abcdefghijklmnopqrstuvwxyz"
1142
1150
dim_map = {d : einsum_axes [i ] for i , d in enumerate (all_dims )}
1143
1151
1144
- if dims is None :
1152
+ if dims is ...:
1153
+ dims = all_dims
1154
+ elif dims is None :
1145
1155
# find dimensions that occur more than one times
1146
1156
dim_counts = Counter ()
1147
1157
for arr in arrays :
0 commit comments