np.einsum will not accept NoneType for 'out' parameter
See original GitHub issuenp.einsum raises an error when NoneType (‘None’) is passed to the ‘out’ keyword argument. This behavior is not in line with the expected behavior for the out keyword argument of ufunc methods.
Reproducing code example:
import numpy as np
np.einsum('i,j',[1],[2],out=None)
Error message:
Traceback (most recent call last):
File "<ipython-input-2-32138e47a353>", line 1, in <module>
np.einsum('i,j',[1],[2],out=None)
File "<__array_function__ internals>", line 6, in einsum
File "einsumfunc.py", line 1356, in einsum
return c_einsum(*operands, **kwargs)
TypeError: keyword parameter out must be an array for einsum
Numpy/Python version information:
1.18.1 3.7.5 (default, Oct 31 2019, 15:18:51) [MSC v.1916 64 bit (AMD64)]
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
The `out` arguments in `numpy.einsum` can not work as ...
I haven't used this new out parameter before, but have worked with einsum in the past, and have a general idea of how...
Read more >numpy.einsum — NumPy v1.24 Manual
When there is only one operand, no axes are summed, and no output parameter is provided, a view into the operand is returned...
Read more >jax._src.numpy.lax_numpy — Objax 1.6.0 documentation
Since NumPy operations are not primitive and instead are implemented in terms of ... not recognize bfloat16, so arrays are serialized as void16...
Read more >Source code for pytato.array - Index of /
Array: if not isinstance(slice_spec, tuple): slice_spec = (slice_spec,) # FIXME: This doesn't support all NumPy basic indexing constructs, ...
Read more >NumPy Functions — Descartes Labs public documentation
all (ndarray, bool) – A new boolean or array is returned unless out is ... Reference object to allow the creation of arrays...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@eric-wieser, you already fixed this, in https://github.com/numpy/numpy/pull/15256! 😄
Should we add a unit test to ensure it stays fixed?
Is this still an issue? I can reproduce the bug in an older version like 1.17.2, but not on the latest master: