added eval and train for redundancy (#464)

This commit is contained in:
William Falcon 2019-11-05 09:14:33 -05:00 committed by GitHub
parent 32dd803b1e
commit 8fbaccddae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -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()