You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In below example sorter has an index which is out of the range of input array a, but no validation exception raised by dpctl:
a=dpt.asarray([5, 2, 1, 3, 4])
v=dpt.asarray(4)
sorter=dpt.asarray([0, 1, 2, 3, 5])
dpt.searchsorted(a, v, sorter=sorter)
# Out: usm_ndarray(4)a=numpy.asarray([5, 2, 1, 3, 4])
v=numpy.asarray(4)
sorter=numpy.asarray([0, 1, 2, 3, 5])
numpy.searchsorted(a, v, sorter=sorter)
---------------------------------------------------------------------------ValueErrorTraceback (mostrecentcalllast)
CellIn[10], line1---->1numpy.searchsorted(a, v, sorter=sorter)
File~/miniconda3/envs/dpnp_dev/lib/python3.9/site-packages/numpy/core/fromnumeric.py:1400, insearchsorted(a, v, side, sorter)
1332 @array_function_dispatch(_searchsorted_dispatcher)
1333defsearchsorted(a, v, side='left', sorter=None):
1334""" 1335 Find indices where elements should be inserted to maintain order. 1336 (...) 1398 1399 """->1400return_wrapfunc(a, 'searchsorted', v, side=side, sorter=sorter)
File~/miniconda3/envs/dpnp_dev/lib/python3.9/site-packages/numpy/core/fromnumeric.py:59, in_wrapfunc(obj, method, *args, **kwds)
56return_wrapit(obj, method, *args, **kwds)
58try:
--->59returnbound(*args, **kwds)
60exceptTypeError:
61# A TypeError occurs if the object does have such a method in its62# class, but its signature is not identical to that of NumPy's. This
(...)
66# Call _wrapit from within the except clause to ensure a potential67# exception has a traceback chain.68return_wrapit(obj, method, *args, **kwds)
ValueError: Sorterindexoutofrange.
The text was updated successfully, but these errors were encountered:
Yes, we use default index wrap mode. Perhaps this needs to be explicitly documented, but it is done for performance reasons. It is consistent with behavior of __getitem__ and of dpctl.tensor.take.
dpnp can use dpt.min, dpt.max to implement its own validation, if deemed necessary.
Uh oh!
There was an error while loading. Please reload this page.
In below example
sorter
has an index which is out of the range of input arraya
, but no validation exception raised by dpctl:The text was updated successfully, but these errors were encountered: