I meet cuda Error when I tried to do slice operation.
try:
sub_x = [xx[sub_valid_indices, ...] for xx in x]
except Exception as e:
print("### x.shape={}, sub_valid_indices={}".format([xx.shape for xx in x], sub_valid_indices))
exit(1)
The output log is “x.shape=[torch.Size([2, 3, 32, 32])], sub_valid_indices=[0, 1]”
It seems that the indice is not output of range.