Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/pytblis/einsum_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,12 @@ def einsum(*operands, out=None, optimize=True, complex_real_contractions=True, *
'A' means it should be 'F' if the inputs are all 'F', 'C' otherwise.
'K' is ignored, for now.
Default is 'C'.
optimize : {False, True, 'greedy', 'optimal'}, default True
optimize : {bool, list, tuple, 'greedy', 'optimal'}, default True
Controls the optimization strategy used to compute the contraction.
If a tuple is provided, the second argument is assumed to be
the maximum intermediate size created.
Also accepts an explicit contraction list from the ``np.einsum_path``
function. See ``np.einsum_path`` for more details.
complex_real_contractions : bool, default True
If True, handle contractions between complex and real tensors by performing
separate contractions for the real and imaginary parts of the complex tensor.
Expand All @@ -69,8 +73,6 @@ def einsum(*operands, out=None, optimize=True, complex_real_contractions=True, *
The calculation based on the Einstein summation convention.
"""
specified_out = out is not None
if optimize not in (False, True, "greedy", "optimal"):
raise ValueError("optimize must be one of False, True, 'greedy', or 'optimal'")

# Check the kwargs to avoid a more cryptic error later, without having to
# repeat default values here
Expand Down