We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
import torch import random torch.manual_seed(0) random.seed(0) xpu_device = torch.device("xpu") cpu_device = torch.device("cpu") #tensor_dtype = torch.int64 tensor_dtype = torch.bool value_range = 2 a = torch.randint(value_range, (4099,)).to(dtype=tensor_dtype).to(xpu_device) print(a) print(a.shape) for dim in reversed(range(a.dim())): #output, output_indices = torch.mode(a, dim) #print(output) sorted, indices = torch.sort(a) print(sorted) sorted, indices = a.sort() print(sorted) sorted, indices = a.sort(stable=True) print(sorted) sorted_cpu, indices = torch.sort(a.to(cpu_device)) res = torch.equal(sorted.to(cpu_device), sorted_cpu) print(res)
sort result is wrong:
tensor([False, True, True, ..., False, True, True], device='xpu:0') torch.Size([4099]) tensor([False, True, True, ..., False, False, False], device='xpu:0') tensor([False, True, True, ..., False, False, False], device='xpu:0') tensor([False, True, True, ..., False, False, False], device='xpu:0') False
The text was updated successfully, but these errors were encountered:
Complete the logic for the AB buffer in segmented radix sort. (#1037)
8a55cbf
Resolve #1022
xytintel
Successfully merging a pull request may close this issue.
🐛 Describe the bug
Versions
sort result is wrong:
tensor([False, True, True, ..., False, True, True], device='xpu:0')
torch.Size([4099])
tensor([False, True, True, ..., False, False, False], device='xpu:0')
tensor([False, True, True, ..., False, False, False], device='xpu:0')
tensor([False, True, True, ..., False, False, False], device='xpu:0')
False
The text was updated successfully, but these errors were encountered: