Skip to content

Commit

Permalink
Trainable NM fix - removing no_grad()
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Kornuta <[email protected]>
  • Loading branch information
tkornuta-nvidia committed May 22, 2020
1 parent 9f037f6 commit f244a30
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions nemo/backends/pytorch/nm.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@ def __init__(self, name=None):
def __call__(self, force_pt=False, *input, **kwargs):
pt_call = len(input) > 0 or force_pt
if pt_call:
with t.no_grad():
return self.forward(*input, **kwargs)
return self.forward(*input, **kwargs)
else:
return NeuralModule.__call__(self, **kwargs)

Expand Down

0 comments on commit f244a30

Please sign in to comment.