Skip to content

Commit

Permalink
handle output_tensor == None
Browse files Browse the repository at this point in the history
  • Loading branch information
lmcafee-nvidia committed Jan 13, 2022
1 parent 8fc5e32 commit 7f1c591
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions megatron/schedules.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def deallocate_output_tensor(out):
sent to the next pipeline stage. At this point, the output tensor is
only useful for its '.grad_fn' field, and not its '.data'.
'''
if out is None:
return
assert isinstance(out, torch.Tensor), \
"expected Tensor, found %s." % type(out).__name__
assert out._base is None, \
Expand Down

0 comments on commit 7f1c591

Please sign in to comment.