mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-09 11:32:07 +08:00
added eval and train for redundancy (#464)
This commit is contained in:
@@ -247,6 +247,10 @@ class LightningModule(GradInformation, ModelIO, ModelHooks):
|
||||
for param in self.parameters():
|
||||
param.requires_grad = False
|
||||
|
||||
self.eval()
|
||||
|
||||
def unfreeze(self):
|
||||
for param in self.parameters():
|
||||
param.requires_grad = True
|
||||
|
||||
self.train()
|
||||
|
||||
Reference in New Issue
Block a user