No I mean there should be one line code before A = B.unsqueeze(1)... that use advanced indexing operation, like C=A[:,B,1], It’s this line of code goes wrong, but because of the cuda’s asynchronous mode, you get error a while after that.