Skip to content

Commit c308047

Browse files
committed
fix doc string
1 parent 12d4bc3 commit c308047

File tree

1 file changed

+23
-21
lines changed

1 file changed

+23
-21
lines changed

dpnp/dpnp_iface_linearalgebra.py

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ def dot(a, b, out=None):
169169

170170
def einsum(*operands, out=None, optimize=False, **kwargs):
171171
"""
172-
einsum(subscripts, *operands, out=None, dtype=None, order="K", casting="safe", optimize=False)
172+
einsum(subscripts, *operands, out=None, dtype=None, order="K", \
173+
casting="safe", optimize=False)
173174
174175
Evaluates the Einstein summation convention on the operands.
175176
@@ -190,27 +191,28 @@ def einsum(*operands, out=None, optimize=False, **kwargs):
190191
If provided, forces the calculation to use the data type specified.
191192
Default is ``None``.
192193
order : {"C", "F", "A", "K"}, optional
193-
Controls the memory layout of the output. "C" means it should
194-
be C-contiguous. "F" means it should be F-contiguous,
195-
"A" means it should be "F" if the inputs are all "F", "C" otherwise.
196-
"K" means it should be as close to the layout as the inputs as
194+
Controls the memory layout of the output. ``"C"`` means it should be
195+
C-contiguous. ``"F"`` means it should be F-contiguous, ``"A"`` means
196+
it should be ``"F"`` if the inputs are all ``"F"``, ``"C"`` otherwise.
197+
``"K"`` means it should be as close to the layout as the inputs as
197198
is possible, including arbitrarily permuted axes.
198199
Default is ``"K"``.
199200
casting : {"no", "equiv", "safe", "same_kind", "unsafe"}, optional
200201
Controls what kind of data casting may occur. Setting this to
201-
`"unsafe"` is not recommended, as it can adversely affect accumulations.
202+
``"unsafe"`` is not recommended, as it can adversely affect
203+
accumulations.
202204
203205
* ``"no"`` means the data types should not be cast at all.
204-
* 'equiv' means only byte-order changes are allowed.
205-
* "safe" means only casts which can preserve values are allowed.
206-
* "same_kind" means only safe casts or casts within a kind,
206+
* ``"equiv"`` means only byte-order changes are allowed.
207+
* ``"safe"`` means only casts which can preserve values are allowed.
208+
* ``"same_kind"`` means only safe casts or casts within a kind,
207209
like float64 to float32, are allowed.
208-
* "unsafe" means any data conversions may be done.
210+
* ``"unsafe"`` means any data conversions may be done.
209211
210212
Default is ``"safe"``.
211213
optimize : {False, True, "greedy", "optimal"}, optional
212214
Controls if intermediate optimization should occur. No optimization
213-
will occur if ``False`` and ``True`` will default to the "greedy"
215+
will occur if ``False`` and ``True`` will default to the ``"greedy"``
214216
algorithm. Also accepts an explicit contraction list from the
215217
:obj:`dpnp.einsum_path` function. Default is ``False``.
216218
@@ -381,8 +383,8 @@ def einsum(*operands, out=None, optimize=False, **kwargs):
381383
larger arrays:
382384
383385
>>> a = np.ones(64000).reshape(20, 40, 80)
384-
385-
Basic `einsum`: 146 ms ± 23.5 ms per loop (benchmarked on 12th
386+
387+
Basic `einsum`: 146 ms ± 23.5 ms per loop (benchmarked on 12th
386388
Gen Intel® Core™ i7-1265U)
387389
388390
>>> %timeit -r 10 -n 50 np.einsum("ijk,ilm,njm,nlk,abc->",a,a,a,a,a)
@@ -461,17 +463,17 @@ def einsum_path(*operands, optimize="greedy", einsum_call=False):
461463
contraction path
462464
* if ``False`` or ``None`` no optimization is taken
463465
* if ``True`` defaults to the "greedy" algorithm
464-
* "optimal" is an algorithm that combinatorially explores all possible
465-
ways of contracting the listed tensors and chooses the least costly
466-
path. Scales exponentially with the number of terms in the
467-
contraction.
468-
* "greedy" is an algorithm that chooses the best pair contraction
466+
* ``"optimal"`` is an algorithm that combinatorially explores all
467+
possible ways of contracting the listed tensors and chooses the
468+
least costly path. Scales exponentially with the number of terms
469+
in the contraction.
470+
* ``"greedy"`` is an algorithm that chooses the best pair contraction
469471
at each step. Effectively, this algorithm searches the largest inner,
470472
Hadamard, and then outer products at each step. Scales cubically with
471-
the number of terms in the contraction. Equivalent to the "optimal"
472-
path for most contractions.
473+
the number of terms in the contraction. Equivalent to the
474+
``"optimal"`` path for most contractions.
473475
474-
Default is "greedy".
476+
Default is ``"greedy"``.
475477
476478
Returns
477479
-------

0 commit comments

Comments
 (0)