Closed jhrmnn closed 3 years ago
Thanks for the PR!
self._t
is actually 1D, it'd be slightly cheaper again to use torch.bucketize
.t
argument needs a .detach()
on it to avoid a spurious error in certain versions of PyTorch.setup.py
.If you can make those tweaks then I'd be happy to accept this PR.
Done.
Btw, searchsorted
and bucketize
calls to the same function under the hood.
Excellent, LGTM!
I actually don't know what it does to speed, though I assume it won't get slower. I was motivated by the memory, which the previous approach required an unnecessary amount because of the broadcasting.