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)