Hi,
The error comes from q = self.embedding(ques) # BxTxD so inside your embedding layer and the assert states Assertion srcIndex < srcSelectDimSize failed.
So I would guess that one of the index given to your embedding layer in ques is larger than the number of classes it was created with?