summaryrefslogtreecommitdiff
path: root/numpy/core/einsumfunc.py
Commit message (Collapse)AuthorAgeFilesLines
* DOC: Fix typos & grammer in docstrings and comments (#23503)Pratyay Banerjee2023-03-301-1/+1
|
* BUG: use explicit einsum_path whenever it is given (#21639)Toshiki Kataoka2022-06-091-4/+16
| | | | | | | | | | | * BUG: use explicit einsum_path whenever it is given For example, allow user to specify unary contractions in binary einsum as described in #20962. The commit also adds a sanity check on user-specified einsum_path. * fix lint * MAINT: refactor logic with explicit_einsum_path
* fix minor typo in commentKent R. Spillner2021-10-131-1/+1
|
* DOC: Misc numpydoc format fixesMatthias Bussonnier2021-01-271-5/+3
| | | | | | | | | Via prototype docstring autoreformatter; and cherry-picked to mostly include spacing issues around colons in parameters and see also. When no space is present numpydoc tend to miss-parse those sections A couple of typos are fixed as well.
* DOC: add references to einops and opt_einsumAlex Rogozhnikov2020-10-031-0/+11
| | | | | | Following discussion in mailing list, this PR adds mentions to third-party libs einops and opt_einsum to einsum documentation
* BUG: fixes einsum ouput order with optimization (#14615)Daniel G. A. Smith2020-06-081-2/+9
|
* BUG: numpy.einsum indexing arrays now accept numpy int type (gh-16080)Ryan2020-05-161-8/+13
| | | | | | | | | | | | | * Using PyArray_PyIntAsIntp helper function instead * TST: add tests for einsum numpy int and bool list subscripts Added tests to check that einsum accepts numpy int64 types and rejects bool. Rejecting bools is new behaviour in subscript lists. I changed ValueError to TypeError on line 2496 in multiarraymodule.c as it is more appropriate. I also modified einsumfunc.py to have the same behaviour as in the C file when checking subscript list. (Reject bools but accept anything else from operator.index()) Closes gh-15961
* STY: use 'yield from <expr>' for simple cases (#15444)Mike Taves2020-01-271-2/+1
| | | | | | | | | This PR uses simple cases of PEP 380 to rewrite: for v in g: yield v into: yield from <expr>
* MAINT: Replace basestring with str.Charles Harris2020-01-231-4/+3
| | | | | | | This replaces basestring with str except in - tools/npy_tempita/ - numpy/compat/py3k.py
* MAINT: Implement keyword-only arguments as syntaxEric Wieser2020-01-061-40/+22
| | | | Now that 2.7 is gone, there is no need to pop manually from kwarg dictionaries.
* MAINT: Remove unnecessary 'from __future__ import ...' statementsJon Dufresne2020-01-031-2/+0
| | | | | As numpy is Python 3 only, these import statements are now unnecessary and don't alter runtime behavior.
* MAINT: Misc. typo fixes (#13664)luzpaz2019-05-311-1/+1
| | | | | | * DOC, MAINT: Misc. typo fixes Found via `codespell`
* MAINT: >>> # style cleanups requestedTyler Reddy2018-12-141-4/+12
| | | | | | | * reviewer requested that the cases where I switched from free-floating comments to `>>> # comments` be reverted to free-floating in docstrings
* TST, DOC: enable refguide_checkTyler Reddy2018-12-141-38/+40
| | | | | | | | * ported the refguide_check module from SciPy for usage in NumPy docstring execution/ verification; added the refguide_check run to Azure Mac OS CI * adjusted NumPy docstrings such that refguide_check passes
* MAINT: Review F401,F841,F842 flake8 errors (unused variables and imports) ↵Roman Yurchak2018-12-061-1/+0
| | | | | | | | | | | | (#12448) * Review F401,F841,F842 flake8 errors (unused variables, imports) * Review comments * More tests in test_installed_npymath_ini * Review comments
* Merge pull request #12443 from rth/set-litteralEric Wieser2018-12-011-2/+2
|\ | | | | MAINT Use set litterals
| * Address review commentsRoman Yurchak2018-11-241-4/+4
| |
| * Use set litteralsRoman Yurchak2018-11-241-4/+4
| |
* | MAINT: Use list and dict comprehension when possible (#12445)Roman Yurchak2018-12-011-6/+3
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use list comprehension * More list comprehension migration * Revert key copying in dict * A few more fixes * More reverts * Use dict comprehension * Fix dict comprehension * Address review comments * More review comments * Fix for empty unpacking of zip(* * Revert zip(* unpacking altogether * Fix dict copying * More simplifications
* MAINT: set __module__ for more array_function_dispatch usesStephan Hoyer2018-10-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I noticed a few more functions using ``array_function_dispatch`` where I had not set the module, using this script:: import types def check_module(module): for name in dir(module): item = getattr(module, name) if isinstance(item, types.FunctionType): print(f'{item.__module__}.{item.__name__}') >>> import numpy >>> check_module(numpy) ... Note that functions without overrides like ``numpy.ones`` still display the module in which they are defined, e.g., ``numpy.core.numeric.ones``. We should probably fix that, too, probably most cleanly adding a decorator that sets ``__module__``, e.g., def set_module(module): def decorator(func): func.__module__ = module return func return decorator ... @set_module('numpy') def ones(shape, dtype=None, order='C'): ...
* ENH: __array_function__ for np.einsum and np.blockStephan Hoyer2018-10-121-0/+21
|
* MAINT: remove unused importsEmil Hessman2018-09-291-1/+1
|
* BUG/ENH: Ensure einsum-optimize dispatches tensordot using ordered axesRyan Soklaski2018-09-101-1/+1
|
* MAINT: Make einsum optimize default to False.Charles Harris2018-08-121-2/+2
| | | | | | | | | False is the documented value and the value used in 1.14, but 1.15.0 was turning optimization on when there were more than two arguments, resulting in slowdowns for small matrices. This choice can be revisited as the einsum optimization code matures. Closes #11714.
* BUG/ENH: Einsum optimization path updates and bug fixes. (#11345)Daniel Smith2018-07-031-76/+224
| | | | | | | | | | | | * Minor tweaks to the optimal path based on opt_einsum * Updates greedy path to current opt_einsum tech * Reworks einsum broadcasting vs dot tech and can_dot logic * MAINT: Fix typo in comment. * BUG: Fix bad merge fixup.
* DOC: Update einsum docs (#11234)attack682018-06-271-62/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Einsum docs improvements. * DOC: add information to numpy.core.einsumfunc * DOC: add information to numpy.core.einsumfunc * DOC: add information to numpy.core.einsumfunc * DOC: add information to numpy.core.einsumfunc * DOC: remove 'numpy.core','c_einsum' section from 'add_newdocs.py' * DOC: make :py:func links to all internal functions. * DOC: make :py:func links to all internal functions (minor corrections) * DOC: place `add_newdoc('numpy.core.multiarray','c_einsum'`,...) in file. * DOC: minor requested corrections * DOC: suggested optimize argument Example cases * DOC: copy amendments to second docstring location in add_newdocs.py * DOC: more descriptive text * DOC: required correction to specify a default argument. * DOC: minor presentation fix for example display in einsumfunc.py * DOC: amend c_einsum documentation version, add note about dual documentation
* einsum bug fix: check array shapes, not array elements, for singleton dimensionsRyan Soklaski2018-05-311-1/+1
|
* MAINT: Misc. typos (#11005)luzpaz2018-04-301-1/+1
| | | | | | | | | User- and non-user-facing typos. Some source typos fixes as well. Found via `codespell`.
* Misc. typosluz.paz2018-02-161-1/+1
| | | | | | | | | | | | | | | | | | | Found via `codespell -q 3 -I ../numpy-whitelist.txt` Whitelist consists of: ``` amin ans behaviour cancellation dum initialise ith nd ot splitted writeable ``` .
* Merge pull request #10359 from mhvk/einsum-do-not-optimize-2-argCharles Harris2018-02-051-2/+2
|\ | | | | BUG: do not optimize einsum with only 2 arguments.
| * BUG: do not optimize einsum with only 2 arguments.Marten van Kerkwijk2018-01-101-2/+2
| | | | | | | | | | | | | | fixes gh-10357. Avoid slow execution of 2-argument einsum calls, by ensuring we use the c code directly.
* | FIX: Deduplicate codeEric Larson2018-01-181-17/+9
| |
* | Patches up broadcasting einsum issues for BLAS casesDaniel Smith2018-01-171-0/+18
| |
* | FIX: Fix einsum optimize logic for singleton dimensionsEric Larson2018-01-141-4/+6
| |
* | BUG: fix einsum issue with unicode input and py2Simon Conseil2018-01-111-3/+4
| | | | | | | | Fix #10369
* | BUG: fix error message not formatted in einsumKenichi Maehashi2018-01-101-3/+4
|/
* Issue #10258 - Change default value of `optimize` argAnna Chiara2017-12-221-1/+1
| | | As per issue #10258, the default value of the `optimize` arg is made consistent with the documentation, making it `True` by default
* DOC: fix minor typosUnknown2017-12-121-1/+1
|
* BUG: Fixes optimal einsum path for multi-contraction intermediatesDaniel Smith2017-09-261-2/+8
|
* ENH: Einsum calls BLAS if it advantageous to do so (#9425)Daniel Smith2017-07-181-10/+155
| | | | | | | | | | * Einsum now optionally uses BLAS * The einsum call is now optimized by default * cleans up the dot logic * MAINT: Correct spelling, tranpose <- transpose.
* ENH: Spelling fixesVille Skyttä2017-05-091-3/+3
|
* MAINT: replace len(x.shape) with x.ndimEric Wieser2017-02-241-1/+1
|
* DOC: added example with empty indices for a scalarMattHarrigan2016-10-141-0/+3
|
* ENH: Allows contraction order optimization in einsum function.Daniel Smith2016-09-261-0/+990