if teacher_forcing_ratio == None:
teacher_forcing_ratio = self.teacher_forcing_ratio
is_teacher = random.random() < teacher_forcing_ratio
output = Variable(trg.data[0,] if is_teacher else outputs[0,]).cuda()
#最后一行出现了两次的这个 [x,] 的结构
python和机器学习都是新手上路,好像在python一般的数组和列表内都见到这种用法
附:trg.data的type好像是torch.tensor(张量什么的小白表示一脸懵)