Q1:def train() 中的model.train()的作用是什么?为什么要写? A1:class torch.nn.Module中 train(mode=True) Sets the module in training mode. This has any effect only on modules such as Dropout or BatchNorm. 参看 http://pytorch.org/docs/master/nn.html Q2:torch.gather()函数的功