-
-
Notifications
You must be signed in to change notification settings - Fork 12.2k
dtype keyword doesn't work as expected for generalized ufuncs #3222
Copy link
Copy link
Closed
Labels
00 - Bug57 - Close?Issues which may be closable unless discussion continuedIssues which may be closable unless discussion continuedcomponent: numpy.linalg
Description
With the generalized ufuncs in gh-2954 / gh-3220:
>>> import numpy as np
>>> np.linalg._umath_linalg.eigvals.signature
'(m,m)->(m)'
>>> np.linalg._umath_linalg.eigvals.types
['f->F', 'd->D', 'D->D']
>>> a = np.array([[1.+2j,2+3j], [3+4j,4+5j]], dtype=np.cdouble)
>>> np.linalg._umath_linalg.eigvals(a, dtype=np.complex128)
__main__:1: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
__main__:1: ComplexWarning: Casting complex values to real discards the imaginary part
array([-0.37228132+0.j, 5.37228132+0.j])
>>> np.linalg._umath_linalg.eigvals(a)
array([-0.35670389-0.26307815j, 5.35670389+7.26307815j])
>>> b = np.array([[1.,2], [3,4]], dtype=np.float64)
>>> np.linalg._umath_linalg.eigvals(b, dtype=np.float64)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: No loop matching the specified signature was found for ufunc eigvals
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
00 - Bug57 - Close?Issues which may be closable unless discussion continuedIssues which may be closable unless discussion continuedcomponent: numpy.linalg