Skip to content

Commit

Permalink
Update module_backend.py
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaranchuk authored Jul 28, 2022
1 parent 7a7c93a commit 0581f86
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions hivemind/moe/server/module_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ def backward(self, *inputs: torch.Tensor) -> Tuple[torch.Tensor, ...]:

with torch.enable_grad():
args = [
tensor.detach().requires_grad_(True)
if tensor.dtype in (torch.half, torch.float, torch.double)
else tensor.detach()
tensor.detach().requires_grad_(True) if tensor.is_floating_point() else tensor.detach()
for tensor in args
]
kwargs = {
Expand Down

0 comments on commit 0581f86

Please sign in to comment.