Describe the issue:
According to the array-api standard for all:
out (array) – if a logical AND reduction was performed over the entire array, the returned array must be a zero-dimensional array containing the test result. Otherwise, the returned array must be a non-zero-dimensional array containing the test results. The returned array must have a data type of bool.
Thus, I expect the return from np.all to definitely be an array. This is not the case .
Reproduce the code example:
>>> import numpy as np
>>> x = np.array([1.0, 2.0])
>>> res = np.all(np.equal(x, x)) # res is np.True_ here, it should be something like np.array(True, dtype=bool)
>>> assert isinstance(res, np.ndarray)
Error message:
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
Cell In[197], line 4
2 x = np.array([1.0, 2.0])
3 res = np.all(np.equal(x, x))
----> 4 assert isinstance(res, np.ndarray)
AssertionError:
Selection deleted
Python and NumPy Versions:
main
Runtime Environment:
No response
How does this issue affect you or how did you find it:
No response
Describe the issue:
According to the array-api standard for
all:Thus, I expect the return from
np.allto definitely be an array. This is not the case .Reproduce the code example:
Error message:
--------------------------------------------------------------------------- AssertionError Traceback (most recent call last) Cell In[197], line 4 2 x = np.array([1.0, 2.0]) 3 res = np.all(np.equal(x, x)) ----> 4 assert isinstance(res, np.ndarray) AssertionError: Selection deletedPython and NumPy Versions:
main
Runtime Environment:
No response
How does this issue affect you or how did you find it:
No response