pytorch積累

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)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章