mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-10-25 12:50:57 +08:00
added eval and train for redundancy (#464)
This commit is contained in:
1 parent
32dd803b1e
commit
8fbaccddae
1 file changed
+4
@@ -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