sorry, i can’t clearly show you the code detail, i just have screenshot and the code link, sorry again:
The code source as follows:
[https://github.com/pytorch/tutorials/blob/master/beginner_source/chatbot_tutorial.py#L892 2]
And the code detail as follows:

21533×855 104 KB
 
11450×479 47 KB