thank you sooo much.
as you said,
change the code
   indices = indices.to(decoder_output.device)
probabilities = probabilities.to(decoder_output.device)

I am a little curious and confused.the "probabilities = " also takes the variable “inputs” as input.should I add the following code.
inputs = inputs.to(decoder_output.device).