To reproduce the bug:
import torch
torch.use_deterministic_algorithms(True)
a = torch.full(torch.zeros(2,10).shape, 0.1, device='cuda:0')
b = (torch.tensor([0, 1, 1]), torch.tensor([1,2,3]))
a[b] = 1
print(a)
Without the second line the code would exit normally.