Merge pull request #12 from VE-FORBRYDERNE/breakmodel

Fix for when breakmodel layers is 0
This commit is contained in:
henk717 2021-08-29 02:26:56 +02:00 committed by GitHub
commit 03a4da0ade
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -291,6 +291,7 @@ def new_forward(
gc.collect() gc.collect()
torch.cuda.empty_cache() torch.cuda.empty_cache()
if ram_blocks:
for param1,param2 in zip(self.h[0].parameters(),self.extrastorage[0].parameters()): for param1,param2 in zip(self.h[0].parameters(),self.extrastorage[0].parameters()):
param1.data = param2.data.to(gpu_device, non_blocking=False).detach() param1.data = param2.data.to(gpu_device, non_blocking=False).detach()