Closed
Description
Consider
In [1]: import array_api_strict as xp
In [2]: M = 6
In [3]: n = xp.arange(0, M, dtype=xp.float64)
In [4]: n <= (M-1)/2.0
Out[4]:
Array([ True, True, True, False, False,
False], dtype=array_api_strict.bool)
In [5]: xp.less_equal(n, (M-1)/2.0)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[5], line 1
----> 1 xp.less_equal(n, (M-1)/2.0)
File ~/miniforge3/envs/scipy-dev/lib/python3.12/site-packages/array_api_strict/_elementwise_functions.py:539, in less_equal(x1, x2)
533 def less_equal(x1: Array, x2: Array, /) -> Array:
534 """
535 Array API compatible wrapper for :py:func:`np.less_equal <numpy.less_equal>`.
536
537 See its docstring for more information.
538 """
--> 539 if x1.dtype not in _real_numeric_dtypes or x2.dtype not in _real_numeric_dtypes:
540 raise TypeError("Only real numeric dtypes are allowed in less_equal")
541 # Call result type here just to raise on disallowed type combinations
AttributeError: 'float' object has no attribute 'dtype'
Metadata
Metadata
Assignees
Labels
No labels