pytorch学习笔记
model.eval()
CLASS torch.nn.Module
nn.Module中的一个方法:
eval()
Sets the module in evaluation mode.将模型设置为evaluation模式。
源代码:
def eval(self):
r"""Sets the module in evaluation mode.
This has any effect only on certain modules. See documentations of
particular modules for details of their behaviors in training/evaluation
mode, if they are affected, e.g. :class:`Dropout`, :class:`BatchNorm`,
etc.
"""
return self.train(False)