Skip to content

Commit

Permalink
improve memory usage
Browse files Browse the repository at this point in the history
  • Loading branch information
cyvius96 committed Nov 25, 2018
1 parent a3f8f1e commit 1ad07d8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions train.py
Expand Up @@ -88,6 +88,8 @@ def save_model(name):
optimizer.zero_grad()
loss.backward()
optimizer.step()

proto = None; logits = None; loss = None

tl = tl.item()
ta = ta.item()
Expand All @@ -114,6 +116,8 @@ def save_model(name):

vl.add(loss.item())
va.add(acc)

proto = None; logits = None; loss = None

vl = vl.item()
va = va.item()
Expand Down

0 comments on commit 1ad07d8

Please sign in to comment.