New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[known issue] kthvalue not available on CUDA #2134
Projects
Comments
vadimkantorov
changed the title
kthvalue not available on CUDA
[known issue] kthvalue not available on CUDA
Jul 17, 2017
A workaround for now would be to use def kthvalue(tensor, k, dim=None):
val, idx = tensor.topk(k, dim)
return val[:1], idx[:1] |
# dim = None wouldn't work because topk requires a dim argument if largest = False is used
def kthvalue(tensor, k, dim=-1):
val, idx = tensor.topk(k, largest = False, dim = dim)
return val[-1:], idx[-1:] |
Hi, can I work on this? |
sure thing @AnishShah ! |
fix worked on in #8406 |
Fixed in #17544 |
xwang233
pushed a commit
to xwang233/pytorch
that referenced
this issue
Nov 9, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
torch.arange(1, 10).cuda().kthvalue(5)
will throwA known issue (https://discuss.pytorch.org/t/missing-kthvalue-on-gpu/1798/2)
The text was updated successfully, but these errors were encountered: