@@ -169,8 +169,7 @@ def dot(a, b, out=None):
169
169
170
170
def einsum (* operands , out = None , optimize = False , ** kwargs ):
171
171
"""
172
- einsum(subscripts, *operands, out=None, dtype=None, order="K",
173
- casting="safe", optimize=False)
172
+ einsum(subscripts, *operands, out=None, dtype=None, order="K", casting="safe", optimize=False)
174
173
175
174
Evaluates the Einstein summation convention on the operands.
176
175
@@ -199,10 +198,10 @@ def einsum(*operands, out=None, optimize=False, **kwargs):
199
198
Default is ``"K"``.
200
199
casting : {"no", "equiv", "safe", "same_kind", "unsafe"}, optional
201
200
Controls what kind of data casting may occur. Setting this to
202
- "unsafe" is not recommended, as it can adversely affect accumulations.
201
+ ` "unsafe"` is not recommended, as it can adversely affect accumulations.
203
202
204
- * "no" means the data types should not be cast at all.
205
- * " equiv" means only byte-order changes are allowed.
203
+ * `` "no"`` means the data types should not be cast at all.
204
+ * ' equiv' means only byte-order changes are allowed.
206
205
* "safe" means only casts which can preserve values are allowed.
207
206
* "same_kind" means only safe casts or casts within a kind,
208
207
like float64 to float32, are allowed.
@@ -382,9 +381,9 @@ def einsum(*operands, out=None, optimize=False, **kwargs):
382
381
larger arrays:
383
382
384
383
>>> a = np.ones(64000).reshape(20, 40, 80)
385
-
386
- (benchmarked on 12th Gen Intel(R) Core(TM) i7-1265U.)
387
- Basic `einsum`: 146 ms ± 23.5 ms per loop
384
+
385
+ Basic `einsum`: 146 ms ± 23.5 ms per loop (benchmarked on 12th
386
+ Gen Intel® Core™ i7-1265U)
388
387
389
388
>>> %timeit -r 10 -n 50 np.einsum("ijk,ilm,njm,nlk,abc->",a,a,a,a,a)
390
389
0 commit comments