For two dimension indexing, try following:
B, C1, C2 = 32, 1024, 3
input = torch.rand((B, C1, C2))  # [32, 1024, 3]
idx1 = torch.arange(B).view(-1, 1)  # [32, 1]
idx2 = torch.randint(low=0, high=C1, size=(B, 80))  # [32, 80]
output = input[idx1, idx2]  # [32, 80, 3]

Similarly, for three dimension indexing:
B, C1, C2, C3 = 32, 1024, 16, 3
input = torch.rand((B, C1, C2, C3))  # [32, 1024, 16, 3]
idx1 = torch.arange(B).view(-1, 1, 1)  # [32, 1, 1]
idx2 = torch.arange(C1).view(1, -1, 1)  # [1, 1024, 1]
idx3 = torch.randint(low=0, high=C2, size=(B, C1, 8))  # [32, 1024, 8]
output = input[idx1, idx2, idx3]  # [32, 1024, 8, 3]