torchsearchsorted icon indicating copy to clipboard operation
torchsearchsorted copied to clipboard

Implemented `side` parameter (resolves #1)

Open baldassarreFe opened this issue 5 years ago • 2 comments

This PR includes:

  • C++ code for searchsorted with correct support of side=[left|right]
  • CUDA code for searchsorted with correct support of side=[left|right]
  • helper functions for broadcasting numpy arrays and pytorch tensors to be used in searchsorted
  • more unit tests to make sure all of the above work
  • minor changes in the README (how to check CUDA availability during installation, how to run tests, how to run the benchmark)
  • new benchmark script that uses the builtin timeit

Please check out the new implementation (the CUDA and C++ part should be much more readable), run the unit tests and let me know if you get similar times in the benchmark ;)

baldassarreFe avatar Nov 19 '19 20:11 baldassarreFe

thank you very much I'll review this shortly

aliutkus avatar Nov 20 '19 20:11 aliutkus

I've noticed the speed issue, I think it could be related to the left/right side, which at least in this version gives correct results. Anyway, I'll look into speeding up the implementation ;)

baldassarreFe avatar Nov 25 '19 15:11 baldassarreFe