MCPcopy Create free account
hub / github.com/PythonOT/POT / searchsorted

Method searchsorted

ot/backend.py:2603–2612  ·  view source on GitHub ↗
(self, a, v, side="left")

Source from the content-addressed store, hash-verified

2601 return cp.argsort(a, axis)
2602
2603 def searchsorted(self, a, v, side="left"):
2604 if a.ndim == 1:
2605 return cp.searchsorted(a, v, side)
2606 else:
2607 # this is a not very efficient way to make numpy
2608 # searchsorted work on 2d arrays
2609 ret = cp.empty(v.shape, dtype=int)
2610 for i in range(a.shape[0]):
2611 ret[i, :] = cp.searchsorted(a[i, :], v[i, :], side)
2612 return ret
2613
2614 def flip(self, a, axis=None):
2615 return cp.flip(a, axis)

Callers

nothing calls this directly

Calls 1

searchsortedMethod · 0.45

Tested by

no test coverage detected