Based on the first error message, if seems that an indexing is failing:
Assertion `srcIndex < srcSelectDimSize` failed

You could either check the tensors for the failing operation (might be in self.auxencoder(ctx_tokens, ctx_lengths)) or run the code on the CPU to get a better error message.